linux命令返回的退出状态1的含义

linux命令返回的退出状态1的含义

本文介绍了linux命令返回的退出状态1的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

linux命令返回的退出状态1是什么意思?像127一样,退出状态表示找不到命令".

What is meaning of exit status 1 returned by linux command? Like 127 exit status indicates "command not found".

我已经访问了 http://linux.die.net/abs-guide/exitcodes .html 页面,这是否表示退出状态1没有特别的含义?

I have visited http://linux.die.net/abs-guide/exitcodes.html page, does it mean exit status 1 does not have particular special meaning?

推荐答案

唯一的常规约定是零退出状态表示成功,而任何非零退出状态则表示失败.

The only general convention is that a zero exit status signifies success, whereas any non-zero exit status is a failure.

许多-但肯定不是全部-命令行工具会因语法错误而返回退出代码1,即您的参数太少或选项无效.

Many -- but certainly not all -- command-line tools return exit code 1 for syntax error, i.e. you had too few arguments or an invalid option.

很多-但是,不是全部-命令行工具都有手册页.按照惯例,它应记录程序的退出代码,但许多文件则没有.

Many -- but, alas, not all -- command-line tools have a manual page. By convention, it should document the exit codes of the program, but many do not.

这篇关于linux命令返回的退出状态1的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 20:28