sh
sh copied to clipboard
README: clarify that arithmetic expansions perform nested expansions lazily
Your parser permits lazy evaluation of the ternary operator - ? - : -, and gosh does so:
~$ gosh
$ (( 1 + 1 == 2 ? 1 : $( echo foo >&2; echo 1) ))
$ # bash would output foo here
This is great, but perhaps it should be optional or noted somewhere?
Source: http://mywiki.wooledge.org/BashFAQ/031#Theory.
This is a good point. I think we could cover this together with the confusion about a='b + c'; (($a)) not working like in Bash.