![]() |
Bash scripting silly question
hello.. I've found a way to increase lets say a counter... but I think my way is stupid, there must be better solution...
Code:
hey=1but I'm not familiar with the right syntax. Thanks. |
What about
Code:
let hey+=1 |
Alternative:
Code:
hey=$(($hey+1)) |
If it is a loop counter, you can use this form of the "for" command:
for (( index=100; index<200; index++ )); do |
Oh, I completely forgot about
Code:
let hey++ |
The old (and more portable) way :
Code:
hey=`expr $hey + 1` |
| All times are GMT -5. The time now is 09:56 PM. |