News for hackers. Stuff that matters.
Re:The Open Group Base Specifications Issue 8 by ykonstant on Thursday July 25, 2024 @05:46AM (#41066707)
>Note, however, that "$(( x=5 ))" need not be equivalent to "$(( $x=5 ))" . If the value of the environment variable x is the string "y=" , the expansion of "$(( x=5 ))" would set x to 5 and output 5, but "$(( $x=5 ))" would output 0 if the value of the environment variable y is not 5 and would output 1 if the environment variable y is 5. Similarly, if the value of the environment variable is 4, the expansion of "$(( x=5 ))" would still set x to 5 and output 5, but "$(( $x=5 ))" (which would be equivalent to "$(( 4=5 ))" ) would yield a syntax error.

Ah, never change, Unix shells :) I still love this bonkers language.

There are no comments on this comment yet.