Created
March 10, 2020 08:56
-
-
Save mkmik/fe3819bf93ad9ddf86ade560f6e611a6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
fake_command() { | |
echo some junk | |
return 1 | |
} | |
demo() { | |
FOO="$(fake_command)" | |
if [ -z "$FOO" ]; then | |
echo output is empty | |
return 1 | |
fi | |
echo output is $FOO | |
} | |
echo "Testing without -e" | |
demo | |
echo "Testing with -e" | |
set -e | |
demo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment