Memo-migrated‎ > ‎

Tips for Bash Programming

posted Jun 25, 2017, 7:05 PM by Teng-Yok Lee   [ updated Jan 2, 2021, 7:26 PM ]
  • Add "set -o errexit" to exit when there are errors.
  • Add "set -o nounset" to exist when there are undefined variables.
  • Add readonly for constant variables.
How to enable the debug mode? (REF, REF)
  • -v: Run shell script in verbose mode.
  • -n: Read the command w/o execution.
  • -x: Show the executed commands & arguments