Somehow I can not get an answer from google for this. I wan to do a simple if, then, to toggle the value of a variable between 1 and 0:
The result should be "1".Code:var="0" selection="a" if [ $selection = "a" ]; then toggle $var; fi echo $var
I want to use this in a little interactive script for selecting and deselecting certain options. All the variables values are either zero or one.
Thanks in advance
Just be clear I want $var to toggle between 1 and 0:
Code:echo $var 0 echo $var 1 echo $var 0 echo $var 1