We have already describes few Linux or Unix shell scripts with if or while commands, if you want to increment a value or use in loops . The variable nae is "no",
no=$((no+1))
or
((no+=1))
or
or you can use let:
let "no=no+1"
or
let "var+=1"
For example :
no=1;
for ((n=0;n<10;n++))
do
echo "$no"
no=$((no+1))
done
Comments (0)