P
Peter
Hi,
I am trying to redirect STDERR to STDOUT and catching the returncode
using the script below.
Currently every error is redirected to the terminal instead of to
STDERR or STDOUT, so i am not able to catch the output if it
originates from a process's STDERR.
Any ideas/suggestions why STDERR is not redirectoed ? (i assume that
the RC is always 0 because of the failed STDERR redirection).
## Issue the command by forking the process and monitoring the
output
if (open STATUS, "$cmdstr 2>&1 |") {
while (<STATUS>) {
$result .= $_ ;
}
close STATUS ;
$rcverror = $? >> 8;
$errmsg = $! ;
}
else {
$errmsg = "Fork failed for \'$cmdstr\'" ;
$rcverror = -2 ;
}
# reset the alarm
alarm(0) ;
$rcvtimeout = 0 ;
} ;
Peter
I am trying to redirect STDERR to STDOUT and catching the returncode
using the script below.
Currently every error is redirected to the terminal instead of to
STDERR or STDOUT, so i am not able to catch the output if it
originates from a process's STDERR.
Any ideas/suggestions why STDERR is not redirectoed ? (i assume that
the RC is always 0 because of the failed STDERR redirection).
## Issue the command by forking the process and monitoring the
output
if (open STATUS, "$cmdstr 2>&1 |") {
while (<STATUS>) {
$result .= $_ ;
}
close STATUS ;
$rcverror = $? >> 8;
$errmsg = $! ;
}
else {
$errmsg = "Fork failed for \'$cmdstr\'" ;
$rcverror = -2 ;
}
# reset the alarm
alarm(0) ;
$rcvtimeout = 0 ;
} ;
Peter