I experimented on the latest mac OS with a shell scrip "a.sh" with the following content (exact copy).
#!/bin/bash
echo $BASH_VERSION
a=0
(( a < 100 || 1 / a < 2 )) && echo ok
I got:
3.2.57(1)-release
./a.sh: line 4: ((: a < 100 || 1 / a < 2 : division by 0 (error token is "< 2 ")
Since a < 100 is already true, I thought 1 / a < 2 wouldn't be evaluated.
Can someone help me understand this?