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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -