shell腳本判斷

條件判斷
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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章