Introducing UNIX and Linux |
Introduction to shellsOverview |
Exit statusEvery time a UNIX command terminates, it returns a number,
called its exit status, to the shell that caused
it to run. Depending on the number, the shell can then take
appropriate action. By convention, the exit status of a command is
0 if the command is successful. If a command fails, for whatever
reason, a value different to 0 is returned (and this is typically
1). We can find out the exit status of the previous command
executed by means of the special parameter As an example, create a file (
The Worked exampleWhat is the exit status of
|
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck