bash 127 error return code


Bash scripting. Error value returned from bash script using $? variable. Simple bash script example:

$ cat 


echo $?

Operating System:

Any Linux/Unix

$ ./ 

./ line 3: non-existing-command: command not found


Value 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. 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.

closed #2

opened #3