variable
# work
foo=bar
echo $foo
> bar
# not work
foo = bar
> command not found: foo
echo "value is $foo"
> value is bar
reserved command
# the name of the script
$0
# the first-ninth argument that scirpt takes
$1-9
# the last argument of the previous command
$_
mkdir test
cd $_
# get the error code from the previous command
$?
# get the previous command
!!
functions
# mcd.sh
mcd () {
# $1 means the first argument of input
mkdir -p "$1"
cd "$1"
}
# execute this script in our shell and load it
source msc.sh
# now you can use the function in msc.sh defined
mcd test