On Mon, Mar 07, 2005 at 10:30:52AM -0800, Chris Petersen wrote:
You don't want xfilter, you want cc.
Since you want to trap errors, use an exception:
exception {
cc "| /local/bin/somescript"
}
cc will set $EXITCODE for you when sending to a program so you can
still parse on it.
So just to clarify, there's no way to grab STDERR from my script, but
exception will at least let it run and bypass the error message so I can
parse $EXITCODE and recreate the error string if needed?
There may be another way...
I just realized from reading the maildropfilter manpage that the
message is supposed to be available on STDIN when using backticks.
Thus you should be able to use:
exception {
OUTPUT=`/local/bin/somescript`
}
If you only want the STDERR and not STDOUT, try:
exception {
OUTPUT=`/local/bin/somescript 2>&1 > /dev/null`
}
In either case $RETURNCODE will contain the exit code of the script.
The exceptions are probably not needed; remove at your discretion.