for loop (001 to 500)

hey,
how do i create a for loop that runs for i from 001 to 500 ?
i need that the zero prefix will remain so when i print "i" it will
look like so:

001
002
 .
 .
008
009
  . 
  .
058
059
  .
  .
500 

please advise.
thank u for your much appreciated help.

$ i=1; while [ $i -le 500 ]; do printf "%03d\n" $i ; i=$((i+1)); done
1 Like
 
man seq 

see the -w option

---------- Post updated at 03:19 PM ---------- Previous update was at 03:14 PM ----------

i guess it should be

 
seq -w 001 500
1 Like