Optionally, you can write it like this for some shells (ksh, bash).
The arithmetic is done in the same shell. ie. it is not
invoking an external expr for each iteration of the loop.


count=1
while [ $count -lt 284 ]
do
    (( count=count+1 ))
    echo $count
done


-Andy



Chad R. Henry wrote:

>Okay, I admit I'm a total idiot, I just want a simple script that increments by 1 and 
>outputs a string using the result.
>
>What I have is:
>
>count=1
>while [ $count -lt 284 ]
>do
>       count='expr $count + 1'
>       echo "http://foo.foo.org/foo[$count].file"; >> /home/user/output
>done
>
>
>Obviously this isn't working and while I've tried to RTFM and figure out why I 
>realize now why I'm a sales guy.
>
>Is anyone willing to help the stupid suit?
>
>Chad
>
>
>*****************************************************************
>To unsubscribe from this list, send mail to [EMAIL PROTECTED]
>with the text 'unsubscribe gnhlug' in the message body.
>*****************************************************************
>



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to