On 11/26/2022 8:19 AM, Milan Zimmermann wrote:
I should add that I realized using {CONDITION} alone is not a
reasonable thing in my examples, as it uses exist status.
In a real code, one would use ${CONDITION}. The modified script is
attached below #####. However, the behavior is still not as expected:
In this case, they should actually be the same thing. When the command
in question is a Lisp function, a nil result sets the exit status to 2.
This doesn't hold for external commands though; the output and the exit
status are independent of one another. In that case, you'd want to spell
it like so:
if {[ 2 -eq 2 ]} { echo "good" }
So in conclusion, I think it's better to prefer {CONDITION} for 'if' forms.