If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Eception handling

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-07, 23:26
manojm17 manojm17 is offline
Registered User
 
Join Date: Mar 2007
Posts: 4
Eception handling

In unix shell scripting how the exception handling is done.
Reply With Quote
  #2 (permalink)  
Old 03-23-07, 15:47
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You check the return codes of various commands using the $? environment variable. This variable contains the exit status of the previous command.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 04-19-07, 15:34
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
You could also look at the 'trap' command, which you can use to set up conditions for when a particular signal is returned from a process.

e.g.

trap 'doSomeStuff' 1 2 15

(where 1, 2 and 15 are exit statuses you would like to be caught by the trap)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On