From a script ( running multiple times simultaneously ), I would like create a file something like:
echo "0" > /tmp/count
Then I would like to do three functions.
incr /tmp/count decr /tmp/count is_zero /tmp/count
which do thje fairly obvious thing: increment the value in /tmp/count, decrement the value in /tmp/count and test if the value is_zero.
I can write three C programs to do this, but am hoping that there already exists a way. Any suggestions?