3 ms·
Another fun one is that set -e export x=$(false) echo ok prints ok, but set -e export x x=$(false) echo ok exits early because o
by ben0x539 9y ago
Another fun one is that
set -e
export x=$(false)
echo ok
prints ok, but
set -e
export x
x=$(false)
echo ok
exits early because of the `false`.
- CyberShadow 9y agoThankfully ShellCheck detects this one.
- unhammer 9y agoBut here http://www.shellcheck.net/ http://www.shellcheck.net/ gives Line 4: export x=$(false) ^-- SC2155: Declare and assign separately to avoid masking return values.