Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] padding digits on counting loops, how ?


On 08/02/04 08:17, Voytek wrote:
Peter Hardy said:

On 08/02/04 01:26, Voytek wrote:

how can I allow for leading zero for days 1-9 in below example:
n=32
let i=1
while [ $i -lt $n ]; do

*snip stuff*
Replace the while loop with a for loop using seq(1) to generate the
sequence. Use the -w option to pad:

for $i in `seq -w 1 32`; do
*re-add stuff*


thanks, Pete.
how do I initialize 'i'..?:

Oh, dang, that was supposed to be i not $i.

I guess it was a little past my bedtime. :-(

--
Pete