On 8/1/20 8:47 PM, Lawrence Velázquez wrote: >> let v+=1 # Line 18, Once line 11 is uncommented, Bash fails here > > I haven't seen the code for arithmetic expansion, but I assume it > treats v+=1 as morally equivalent to v=${v}+1 (à la C99). Thus there > *is* an expansion, which fails under set -u. Regardless of the > particulars, ksh and zsh again agree:
This is indeed what happens in an arithmetic context. It happens with pre- and post-increment and decrement operators, too. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/