Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    4

    Unanswered: Eception handling

    In unix shell scripting how the exception handling is done.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •