FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-10-2008, 12:22 AM
"Joseph L. Casale"
 
Default Shell Script Question

What's the simplest way to increment the number 0000 up by one until some other 4 digit number while
preserving leading zero's until the 1000's has a digit other than 0?

Thanks!
jlc
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-10-2008, 12:29 AM
Steve Thompson
 
Default Shell Script Question

On Wed, 9 Jul 2008, Joseph L. Casale wrote:


What's the simplest way to increment the number 0000 up by one until some other 4 digit number while
preserving leading zero's until the 1000's has a digit other than 0?


In zsh, it would be something like:

for i in {0000..9999}; do
echo $i
done

-steve
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 11:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org