Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

exit 2

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-14-2007
xramm xramm is offline
Registered User
 
Join Date: May 2007
Last Activity: 20 October 2009, 10:27 AM EDT
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
CPU & Memory exit 2

Hi
even though I use exit in my first scripts, I am not sure exactly about exit codes.I know there is a relation between return and exit codes, exit 0 means it returned a 0 to indicate there is no error at the end of this point.
But what does it mean:
exit 1 , probably there was an error, OK then what is it?
exit 2

please let me know, best regards.
Sponsored Links
    #2  
Old Unix and Linux 08-14-2007
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 27 April 2015, 10:26 AM EDT
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 448 Times in 264 Posts
The author of the script decides what the exit codes mean. Maybe "exit 1" means a unknown argument was encounted when the script was parsing its arguments. Or maybe "exit 7" means that. It is up to the author to decide. For me "exit 1" usually means the first error that I coded a check for. "exit 2" means the 2nd error I coded a check for. And so on.
Sponsored Links
    #3  
Old Unix and Linux 08-15-2007
xramm xramm is offline
Registered User
 
Join Date: May 2007
Last Activity: 20 October 2009, 10:27 AM EDT
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb exit codes and meaning

Thank you Perderado ,

I fortunately noticed your a tutorial link and want to re-share here,because all answers to my question seems to be there:

http://www.tldp.org/LDP/abs/html/exitcodes.html

Linux
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
RE: exit value vslewis Shell Programming and Scripting 1 10-07-2008 01:23 PM
what is meaning of exit(0) and exit(1) amitpansuria UNIX for Dummies Questions & Answers 1 08-28-2007 03:02 AM
exit(0) versus exit(1) enuenu Programming 9 06-22-2007 10:56 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 05:08 PM



All times are GMT -4. The time now is 11:28 PM.