Bash Cheatsheet

Variables

NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}!"

String Quotes

NAME="John"
echo "Hi $NAME"  #=> Hi John
echo 'Hi $NAME'  #=> Hi $NAME

Functions

get_name() {
  echo "John"
}

echo "You are $(get_name)"