Re: Pipes and Erroneous Exit Status

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 03/01/05


Date: Mon, 28 Feb 2005 23:55:06 -0600


absinth wrote:

> I'm running an SQL query application and piping that into sed for
> post-processing.
>
> E.g. sqlPlus ... | sed ....
>
> How do I capture the exit status from sqlPlus and exit on erroneous
> status?
>
> For example if someone enters an invalid query sqlPlus would quit with
> a non zero exit status but this output is piped to sed and sed
> completes successfully changing the exit status to 0. Is there a way
> around this?
>

See question 13 in the FAQ (http://home.comcast.net/~j.p.h/cus-faq.html#M).

        Ed.



Relevant Pages

  • Re: Sqlplus in Batch file.
    ... must be in .par file like this: ... when I run this .bat file in CMD prompt it open a new CMD logged in ... Sqlplus but it does not the Statement specified. ... exit -- To exit SQL*Plus and terminate the session ...
    (comp.databases.oracle.misc)
  • Re: Sqlplus in Batch file.
    ... must be in .par file like this: ... when I run this .bat file in CMD prompt it open a new CMD logged in ... Sqlplus but it does not the Statement specified. ... exit -- To exit SQL*Plus and terminate the session ...
    (comp.databases.oracle.misc)
  • Re: Redirect part of script
    ... Now each of these tasks produces its own output and I need to capture ... (sqlplus user/pass@sid <<EOF ...
    (comp.unix.shell)
  • Re: Redirect part of script
    ... Now each of these tasks produces its own output and I need to capture ... (sqlplus user/pass@sid <<EOF ...
    (comp.unix.shell)
  • Re: Pipes and Erroneous Exit Status
    ... > post-processing. ... > How do I capture the exit status from sqlPlus and exit on erroneous ...
    (comp.unix.shell)