Shell Scripting Cheat Sheet

Linux shell scripting is cool but it’s syntax is not (for me). I always have to search online for syntax. This post will serve as a cheatsheet to shell scripting and will always be WIP.

Variables

name="Tom"
echo $name

Conditionals

Arrays

numbers=( 1 2 3 4 )

Loops

for num in ${numbers[@]}
do
  echo $num
done

Functions

say_hello()
{
  echo "Hello"
}

say_hello

Other articles with the same tag

Back