127 Return code from $?

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

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

8条回答
  •  不思量自难忘°
    2020-11-22 11:12

    This error is also at times deceiving. It says file is not found even though the files is indeed present. It could be because of invalid unreadable special characters present in the files that could be caused by the editor you are using. This link might help you in such cases.

    -bash: ./my_script: /bin/bash^M: bad interpreter: No such file or directory

    The best way to find out if it is this issue is to simple place an echo statement in the entire file and verify if the same error is thrown.

提交回复
热议问题