Created
September 22, 2017 07:54
-
-
Save wjt/2bcb4a9705db683c8d8292e3cc4ac9d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
f() { | |
local x=$(echo oh no; false) | |
echo "f: $x" | |
} | |
g() { | |
local y | |
y=$(echo oh no; false) | |
echo "g: $y" | |
} | |
f | |
g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ f | |
++ echo oh no | |
++ false | |
+ local 'x=oh no' | |
+ echo 'f: oh no' | |
f: oh no | |
+ g | |
+ local y | |
++ echo oh no | |
++ false | |
+ y='oh no' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In declare-and-assign.sh line 3: | |
local x=$(echo oh no; false) | |
^-- SC2155: Declare and assign separately to avoid masking return values. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment