Let's consider a following back script example. The script returns error value using $? variable.
$ 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
127
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.

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.
FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions