Unix program exit status




















Active Oldest Votes. However, POSIX-like shells including Bash reserve a range of high exit statuses for internal use, to signal that something went wrong in the called command without that command having a chance to return an explicit exit status Bash manual : For the shell's purposes, a command which exits with a zero exit status has succeeded. Improve this answer. Community Bot 1.

TooTea TooTea 1, 7 7 silver badges 15 15 bronze badges. Juan Juan 3 3 silver badges 10 10 bronze badges. Thank you for your feedback, Hello Juan I know the exit status 0 and 1, what about the variable exit status 86, 87 actually this is reserved number or it's random. AjilRaju regarding to exit status, nothing is reserved.

As every answer here says, the Exit status are "conventions". Every developer set a "meaning" for every exit status in their own software. Usually the developers document that meaning in the manual pages or in a text file distributed with the software. So practically speaking, we can say that they are random. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Previous Page. Next Page. Useful Video Courses.

More Detail. Essentials of Unix Operating System 5 Lectures 4. Then the error code should be destiguishable from user input errors. The rest of them I think are program dependant. As devnull said, any exit code that is not zero implies an unsuccessful termination. There are conventions for what sorts of status values certain programs should return. The most common convention is simply 0 for success and 1 for failure Otherwise the status returned is implementation-defined.

If you want indicate other errors, you should reinvent your own exit statuses. For example:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Some programs even use the returned value to report the integer number of discovered runtime errors e. Sign up to join this community. The best answers are voted up and rise to the top.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. Asked 7 years, 11 months ago. Active 4 years, 10 months ago. Viewed 98k times. Improve this question. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. Add a comment. Active Oldest Votes. There is no "recipe" to get the meanings of an exit status of a given terminal command.

Improve this answer. In shell the exit status are as follow based on Bash : 1 - - Command did not complete successfully.



0コメント

  • 1000 / 1000