127 Return code from $?

后端 未结 8 2164
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 10:23

What is the meaning of return value 127 from $? in UNIX.

8条回答
  •  不要未来只要你来
    2020-11-22 11:09

    It has no special meaning, other than that the last process to exit did so with an exit status of 127.

    However, it is also used by bash (assuming you're using bash as a shell) to tell you that the command you tried to execute couldn't be executed (i.e. it couldn't be found). It's unfortunately not immediately deducible though, if the process exited with status 127, or if it couldn't found.

    EDIT:
    Not immediately deducible, except for the output on the console, but this is stack overflow, so I assume you're doing this in a script.

提交回复
热议问题