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'..?: (btw, I'm pasting this from clipboard, does it need to written as a script maybe ??) # for $i in `seq -w 1 32`; do > /usr/local/awstats/wwwroot/cgibin/awstats.pl -config=celaro.com -log file=/home/celaro.com/logs/2004-07-$i-access.rog -update > let i=i+1 > done bash: `$i': not a valid identifier # # let i=1 # for $i in `seq -w 1 32`; do > /usr/local/awstats/wwwroot/cgibin/awstats.pl -config=celaro.com -log file=/home/celaro.com/logs/2004-07-$i-access.rog -update > let i=i+1 > done bash: `$i': not a valid identifier # Voytek -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
