国产精品久久久久久久久久东京,亚洲视频免费播放,少妇人妻精品一区二区三区视频,日韩一级品

好房網(wǎng)

網(wǎng)站首頁(yè) 互聯(lián)網(wǎng) > 正文

linux中exit什么意思(linux指令后添加 exit 0什么意思)

2022-05-20 09:52:13 互聯(lián)網(wǎng) 來源:
導(dǎo)讀 相信目前很多小伙伴對(duì)于linux指令后添加 exit 0什么意思都比較感興趣,那么小編今天在網(wǎng)上也是收集了一些與linux指令后添加 exit 0什么

相信目前很多小伙伴對(duì)于linux指令后添加 exit 0什么意思都比較感興趣,那么小編今天在網(wǎng)上也是收集了一些與linux指令后添加 exit 0什么意思相關(guān)的信息來分享給大家,希望能夠幫助到大家哦。

使腳本返回碼為0,表示成功

exit命令用于退出當(dāng)前shell,在shell腳本中可以終止當(dāng)前腳本執(zhí)行。



常用參數(shù)

格式:exit n
退出。

設(shè)置退出碼為n。

(Cause the shell to exit with a status of n.)

格式:exit
退出。

退出碼不變,即為最后一個(gè)命令的退出碼。

(If n is omitted, the exit status is that of the last command executed. )

格式:$?
上一個(gè)命令的退出碼。



格式:trap commands EXIT
退出時(shí)執(zhí)行commands指定的命令。

( A trap on EXIT is executed before the shell terminates.)

退出碼(exit status,或exit code)的約定:

0表示成功(Zero - Success)
非0表示失敗(Non-Zero - Failure)
2表示用法不當(dāng)(Incorrect Usage)
127表示命令沒有找到(Command Not Found)
126表示不是可執(zhí)行的(Not an executable)
=128 信號(hào)產(chǎn)生。

本文到此結(jié)束,希望對(duì)大家有所幫助。


版權(quán)說明: 本文由用戶上傳,如有侵權(quán)請(qǐng)聯(lián)系刪除!


標(biāo)簽:

最新文章: