exit 2 | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

exit 2

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 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 08-14-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 1 September 2014, 10:15 PM EDT
Location: Ashburn, Virginia
Posts: 9,923
Thanks: 60
Thanked 433 Times in 258 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 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

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:40 AM.