mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
make it clear command return code is "used", not "reused"
@@ -35,7 +35,7 @@ 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 abort immediately, reusing exit code from failed `cd` command
|
||||
* `cd foo || exit` as suggested to abort immediately, using exit code from failed `cd` command
|
||||
* `cd foo || { echo "Failure"; exit 1; }` abort with custom message
|
||||
* `cd foo || ! echo "Failure"` omitting "abort with custom message"
|
||||
* `if cd foo; then echo "Ok"; else echo "Fail"; fi` for custom handling
|
||||
|
Reference in New Issue
Block a user