Scripts that allow combination of several Bash commands.

Structure

Bash scripts have the file extensions .sh.

They always start with a Shebang Line.

It is important to beware of spaces since they can (e.g. in variable declarations) be interpreted as separate commands.

Elements

Bash scripts can contain the following elements:

  • Input and output
  • Arguments
  • Variables
  • Arrays
  • Arithmetic
  • Bash Conditionals
  • Comparison Operators
  • Loops
  • Functions