To assign a variable, use = without space
To use a variable, simply add $ before it
set -xShow what’s executed
$0- Name of the script
$9- Arguments to the script.
$1is the first argument and so on.
$@- All the arguments
$#- Number of arguments
$?- Return code of the previous command
$$- Process identification number (PID) for the current script
!!- Entire last command, including arguments. A common pattern is to execute a command only for it to fail due to missing permissions; you can quickly re-execute the command with sudo by doing
$_- Last argument from the last command. If you are in an interactive shell, you can also quickly get this value by typing