- 分支
if cond;then
commands
fi
if cond;then
commands1
else
commands2
fi
if cond1;then
commands1
elif cond2;then
commands2
else
commands3
fi
case value in
case1)
commands1
case2)
commands2
esac
- 循环
while cond;do
commands
done
util cond;do
commands
done
for var in list;do
commands
done
- 函数
[ function ] funname [()]
{
commands;
[return int]
}
- 模块引用
. /path/module.sh
source /path/module.sh