If...then
if [ expression ]
then
commands
fi
If..then...else
if [ expression ]
then
commands
else
commands
fi
If..then...else If...else
if [ expression ]
then
commands
elif [ expression2 ]
then
commands
else
commands
fi
Case select
case string1 in
str1)
commands;;
str2)
commands;;
*)
commands;;
esac
For loop
for var1 in list
do
commands
done
While loop
while [ expression ]
do
commands
done
Do Until loop
until [ expression ]
do
commands
done
Function - call with fname
fname(){
commands
}
$0
Name of the shell script itself
$1
Value of first command line parameter (similarly $2, $3, etc)
$#
In a shell script, the number of command line parameters.
$*
All of the command line parameters.
varname=value
Create a variable named varname with a value of value