![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is meaning of exit(0) and exit(1) | amitpansuria | UNIX for Dummies Questions & Answers | 1 | 08-28-2007 03:02 AM |
| exit 2 | xramm | Shell Programming and Scripting | 2 | 08-15-2007 09:48 AM |
| exit | dhananjaysk | Shell Programming and Scripting | 2 | 04-06-2006 08:34 AM |
| Where can I find a list of exit codes? (Exit code 64) | jkuchar747 | UNIX for Dummies Questions & Answers | 3 | 12-07-2004 06:08 PM |
| How to exit ssh | davidg | UNIX for Advanced & Expert Users | 1 | 10-16-2003 07:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
For normal exits use 0 (recommended)
and for abnormal program termination or incomplete ones use 1 (recommended) these exit status are indication to the environment from which the program has run about the status of exit of the program |
|
||||
|
What to do you want to tell your parent?
The rules is generally if all went went and you did what you were told (as all children should) then return 0. If something went wrong then return non-zero, preferably between 1 and 127. This is termed the exit code of a process and in a shell becomes the "$?" value. This allows you to do the following Code:
if myprogram
then
echo all went well
else
echo bad things
fi
|
|
||||
|
Thanks, I am still investigating (this and much more).
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|