Skip to main content
3 votes

Bash/Dash - Catching the error when calling set

set is a special built-in, and per POSIX, errors in special built-ins shall cause an interactive shell to exit. But you can use command to "de-specialize" it. (this is straight up mentioned ...
ilkkachu's user avatar
  • 148k
2 votes

Bash/Dash - Catching the error when calling set

In the end I had to run a sub-shell just to check whether set -o pipefail will work. # Workaround for Dash and other shells that do not support -o pipefail. if (set -o pipefail 2>/dev/null); then ...
Ark-kun's user avatar
  • 141
1 vote
Accepted

Cancel just second command of bash logical AND operator

Just do Ctrl+z upon which fg will return with an exit code of 128+SIGTSTP, so not 0/success, so shutdown won't be run, and then fg again without a && shutdown this time. Example: bash-5.3$ ...
Stéphane Chazelas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible