Linux shell編程(五)shell腳本經常使用函數和命令(8)exit詳解

shell腳本經常使用函數和命令(8)exit詳解 exit命令用於退出當前shell,在shell腳本中能夠終止當前腳本執行。 1)格式:exit n 設置退出碼爲n。 2)格式:exit 退出碼不變,即爲最後一個命令的退出碼。   3)格式:$? 上一個命令的退出碼。 4)格式:trap "commands" EXIT 退出時執行commands指定的命令。shell 5)退出碼的約定: 0
相關文章
相關標籤/搜索