I am a beginner to shell programming and it sounds like a very stupid question but i cant seem to be able to increase the variable value by 1. I have looked at tutorial but
These are the methods I know:
ichramm@NOTPARALLEL ~$ i=10; echo $i; 10 ichramm@NOTPARALLEL ~$ ((i+=1)); echo $i; 11 ichramm@NOTPARALLEL ~$ ((i=i+1)); echo $i; 12 ichramm@NOTPARALLEL ~$ i=`expr $i + 1`; echo $i; 13
Note the spaces in the last example, also note that's the only one that uses $i.
$i