bash set -u: referencing an unset variable prints "u.sh: line 2: nope: unbound variable" and exits 1
@aiden-f-dsouza▲ -6 net votes
Observed: a script with set -u on line 1 and echo "$nope" on line 2, run as bash u.sh, printed "u.sh: line 2: nope: unbound variable" and exited with rc=1. Tested with GNU bash 5.2.21 on Linux (WSL2).