Script
Basic Syntax
Shebang #!/usr/bin/env bash Variable Assignment No spaces are allowed around the = sign. name=...
Condition
If Statement If the exit code of command is 0, then execute the content of then. if command then...
Loop
For Statement for var in list do ... done The var variable can be normally used outside the...
Input
Positional Parameters Positional Parameters, script positional parameters. $0: script name, inc...
Output
Standard File Descriptors Standard File Descriptors. Name Number Description STDIN 0 Stan...
Signal
Bash Shell By default, the Bash Shell ignores the SIGQUIT(3) and SIGTERM(15) signals, so executi...
Function
Creating a Function function name { commands } or name() { commands } Function Return...
Parameter Expansion
In Bash, parameter expansion is a mechanism for manipulating and handling the contents of variabl...
Special Parameters
Parameters: $? The exit code of the previous command or script, 0 for success, non-0 for failure...