add abort with custom error message

Anatoli Babenia
2019-08-17 12:49:17 +03:00
parent 409c06a30c
commit 7f319862af

@@ -35,7 +35,8 @@ If/when it does, the script will keep going and do all its operations in the wro
To avoid this, make sure you handle the cases when `cd` fails. Ways to do this include
* `cd foo || exit` as suggested to just abort immediately
* `cd foo || exit` as suggested to abort immediately, reusing exit code from failed `cd` command
* `cd foo || { echo "Failure"; exit 1; }` abort with custom message
* `if cd foo; then echo "Ok"; else echo "Fail"; fi` for custom handling
* `<(cd foo && cmd)` as an alternative to `<(cd foo || exit; cmd)` in `<(..)`, `$(..)` or `( )`