Default Arguments
echo ${var_or_text:-$default_value}Default args use the syntax :- in between the variables
- if
var_or_textis empty or unset, it will use the variabledefault_valueinstead - the first part can also be
1,2,3as in arguments - the second part (or default value) must contain
$if it’s a variable
Bash Script Location
${BASH_SOURCE[0]}- this gets the absolute path of where the bash script is located, not the directory it’s being executed from
"$(dirname ${BASH_SOURCE[0]})"- to access the folder containing the bash script (in case the script depends on another file in the same folder)