On Fri, Dec 27, 2024, at 6:47 PM, Greg Wooledge wrote: > You might have been raised on some other language where the && and || > operators have different precedence. In the shell language, they have > the same precedence.
However, the && and || arithmetic operators do have C-like precedence.
$ echo "$((1 && 1 || 0 && 0))"
1
$ echo "$(( ((1 && 1) || 0) && 0 ))"
0
So be aware of context.
--
vq
