xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

linux & node & cli & exit(0) & exit(1)

exit(0) & exit(1)

demo

  1. exit(0) === OK
  2. exit(1) === some error occurred

bash

https://askubuntu.com/questions/892604/meaning-of-exit-0-exit-1-and-exit-2-in-a-bash-script

exit also makes your script stop execution at that point and return to the command line.

Caveat: Using the proper exit code is not a requirement and is not enforced by the shell. Developers can ignore the guidance if they think it wise.

警告:使用正确的退出代码不是必需的,并且不会由shell强制执行。 如果他们认为明智,开发人员可以忽略指导。

http://www.tldp.org/LDP/abs/html/exitcodes.html

zh-Hans

https://www.cnblogs.com/nufangrensheng/archive/2013/03/01/2938508.html

https://www.cnblogs.com/ECJTUACM-873284962/p/6882448.html

C

https://stackoverflow.com/questions/9944785/what-is-the-difference-between-exit0-and-exit1-in-c


> & >>

覆盖 & 追加


$ echo > readme.md

$ echo >> readme.md

https://unix.stackexchange.com/questions/89386/what-is-symbol-and-in-unix-linux

OK


原文地址:https://www.cnblogs.com/xgqfrms/p/10935090.html