October 12, 2012

Why did the shell command fail with exit code 1?

Why did the shell command fail with exit code 1?

Read the man page for the command. For example, if the command were "grep"...

Read the man page for the command. For example, if the command were "grep" you could do "man grep". The grep man page has an EXIT STATUS section, for example.

EXIT STATUS
The exit status is 0 if selected lines are found, and 1 if not found.
If an error occurred the exit status is 2. (Note: POSIX error handling
code should check for '2' or greater.)

Like  (2 likes)
Click Here!