Exit Status `ls`

EDIT: don't see anything here !!! 127 return means that the command was not found - for some reason she had to specify the absolute path to the command: / (I did not delete if someone else had a problem)

Is there a link to return statuses for regular Linux features like ls ? (this doesn't seem to be on the manual pages, at least not for ls ). If not, can someone tell me what ls return 127 means?

+2
source share
4 answers

127 - an error was not found for the command. In this case, I just needed to use the absolute path to the command ( /bin/ls )

+3
source

according to http://www.opengroup.org/onlinepubs/009695399/utilities/ls.html, a return value of 0 means success, anything> 0 is an error

+1
source

ls not a Bash function. This is an external utility. On Linux, ls is part of the GNU File Utilities. man ls should show you similar information like http://www.gnu.org/software/coreutils/manual/html_node/ls-invocation.html , where only the possible values ​​for its exit status are defined as 0, 1 and 2.

0
source

for ls: "The exit status is 0 if" OK ", 1 if there are minor problems, 2 if there are serious problems."

Source: UNIX User Pages: ls

I suspect your options to find this, in the general case:

  • the male
  • Google
  • source code analysis
0
source

Source: https://habr.com/ru/post/1446784/


All Articles