Skip to content

Instantly share code, notes, and snippets.

@minhd
Created July 16, 2018 05:13
Show Gist options
  • Save minhd/eb923b547cc62b3abf8411c978322789 to your computer and use it in GitHub Desktop.
Save minhd/eb923b547cc62b3abf8411c978322789 to your computer and use it in GitHub Desktop.
Bash script quits if previous return code is not valid #bash
# run something
# rc is not 0, quit
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
# continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment