$ cat bash-127.sh #bin/bash non-existing-command echo $?After execution we can see the the actual error message and bash 127 error return code:
$ ./bash-127.sh ./bash-127.sh: line 3: non-existing-command: command not found 127Value 127 is returned by your shell /bin/bash when any given command within your bash script or on bash command line is not found in any of the paths defined by PATH system environment variable.
The solution is to make sure that the command your are using can be found within your $PATH. If the command is not in your path either include it or use absolute full path to it. For more information see EXIT STATUS section of the bash man page.