incrementing shell variable.. what's wrong? -
incrementing shell variable.. what's wrong? -
i want print hey %d 5 times using shell script.
#/bin/csh set i=0 while ($i < 5) echo "i=$i" echo "hey $i" set i=$i+1 end
it gives me while: badly formed number.
i'm sure problem in incrementing line because if remove line, prints hey 0 repeatedly.
you can utilize expr
:
#/bin/csh set i=0 while ($i < 5) echo "hey $i" set = `expr $i + 1` end
shell
Comments
Post a Comment