Using seq to zero-pad strings in a series
Posted by hank, Sat May 19 08:06:00 UTC 2007
I thought this was pretty cool:
for i in `seq -f "%03g" 1 100`; do wget http://www.gozerog.com/images/Hawking_$i.jpg; done
We were trying to do this the other night using bash, but to no avail since the square brackets only work for local file path expansion. I should have remembered seq. Also, this example shows how to 0-pad a series using seq and bash, noted by the *-f* option. Three cheers for seq!

Blog Posts
May 23, 2007 @ 04:55 PM
:) Good work! Easy and nice