to a shell variable. -E (-o errtrace): Ensures that ERRtraps (see below) get inherited by functions, command substitutions, and subshell environments. So include messages that tell the user to wait for output because a calculation is being done. This page explained bash exit status and related commands. Example-1: Use bash getopts with single argument. #!/bin/bash COMMAND_1 . Bash Beginner Series #7: Decision Making With If Else and Case Statements. Was there ever any actual Spaceballs merchandise? Maybe itâs a 3-line script that just does ânpm install, npm test, npm publishâ, or a 20-line script meant to install everything a coworker needs on their 1st day. Use the exit statement to indicate successful or unsuccessful shell script termination. 8.1.2. If N is set to 0 means normal shell exit. Exit code 0 Success Exit code 1 General errors, Miscellaneous errors, such as "divide by zero" and other impermissible operations Exit code 2 Misuse of shell builtins (according to Bash documentation) Example: empty_function() {} Caveat: Using the proper exit code is ⦠If set, any trap on ERR is inherited by shell functions, command substitutions, and commands executed in a subshell environment. -z " $1 " ];do case " $1 " in -h | --help ) show_usage ;;