bash 4.2
the equation
i=$(( (i+1) %3 ))
I want left i to be 0 when the right i is wrong input like null.
something like i=${((i+3) %3):=0} if I can.
bash 4.2
the equation
i=$(( (i+1) %3 ))
I want left i to be 0 when the right i is wrong input like null.
something like i=${((i+3) %3):=0} if I can.
Let's try with:
i=$(( ( ${i-0} + 1) %3 ))