Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Unanswered: Errors when script calls a script

    We have a remote shell script that calls a script to run jobs. How do I get the calling script to error when the called script errors?

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    assuming the '/path2calledScript' returns the proper stutus upon its exit.

    Code:
    #!/bin/ksh
    
    echo 'this is a calling script'
    
    /path2calledScript
    
    calledScriptStatus="${?}"
    
    if [ "${calledScriptStatus}" -ne 0 ]; then
       exit "${calledScriptStatus}"
    fi;
    .....
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

Posting Permissions

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