Please, observe:
mark@L-R910LPKW:~$ f(){ set -euo pipefail ; git statu; echo $?; } && f && echo OK ; set +euo pipefail
git: 'statu' is not a git command. See 'git --help'.
The most similar commands are
status
stage
stash
1
OK
mark@L-R910LPKW:~$
The command is f(){ set -euo pipefail ; git statu; echo $?; } && f && echo OK ; set +euo pipefail
My question is – why does the function f
NOT abort right after failing to run git statu
? Running the command clearly shows that git statu
failed with exit code 1, but still proceeds further to echo $?
instead of aborting as requested by set -e
.