條件判斷
if格式:
if 條件;then
內容
elif 條件;then
內容
else
內容
fi
case格式:
case 變量引用 in
PAT1}
內容;;
PAT2)
內容;;
....
*)
內容;;
esac
shell配置文件讀取順序
交互式登錄:/etc/profile-->/etc/profile.d/.sh-->~/.bash_profile-->~/.bashrc-->/etc/bashrc
非交互式登錄:/etc/profile.d/.sh-->/etc/bashrc-->~/.bashrc