# Bash script

A Bash script is a file containing a sequence of commands that are executed by the Bash shell, a command-line interpreter in Linux and other Unix-like systems. By writing these scripts, you can automate repetitive tasks, saving time and effort.

# Basic

Bash script

  • Shebang Line
    • The first line of a Bash script typically starts with #!/bin/bash.
    • This line tells the system which interpreter to use to execute the script.
  • Comments: Lines starting with # are treated as comments and are ignored by the interpreter.
  • Variables: They are declared without a specific data type.
  • Control flow: if / else / elif, for / done
  • Functions

# Cheatsheet

Bash script Cheatsheet