Created
September 22, 2016 20:07
-
-
Save terrorobe/d19fa5ef946513d25921cd9b1c36a72b 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
robe@abundantia ~/tmp % cat exit_2.sh | |
#!/bin/sh | |
exit 2 | |
robe@abundantia ~/tmp % cat subshell_one_command.sh | |
#!/bin/bash | |
set -e | |
( | |
./exit_2.sh | |
) | |
robe@abundantia ~/tmp % cat subshell_two_commands.sh | |
#!/bin/bash | |
set -e | |
( | |
echo "starting!" | |
./exit_2.sh | |
) | |
robe@abundantia ~/tmp % ./subshell_one_command.sh | |
2 robe@abundantia ~/tmp % echo $? | |
2 | |
robe@abundantia ~/tmp % ./subshell_two_commands.sh | |
starting! | |
1 robe@abundantia ~/tmp % echo $? | |
1 | |
robe@abundantia ~/tmp % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment