- Original Message -
From: isao <[EMAIL PROTECTED]>
Date: Tuesday, July 1, 2003 7:07 pm
Subject: stdout+stderr to file?
> I'm writing scripts that are basically wrappers for Linux shell
> commands.
> I want to be able to 1) print messages to screen along with say
> the first
> line of
From: "Angus Laycock" <[EMAIL PROTECTED]>
> I want to print messages from a script to either STDOUT or STDERR
> depending on a value of a variable. I want to control where I send the
> print statements to. Can I do something like this or are there other
> ways to control the targ
Angus Laycock wrote:
>
> Hi,
Hello,
> I want to print messages from a script to either
> STDOUT or STDERR depending on a value of a variable.
> I want to control where I send the print statements
> to. Can I do something like this or are there other
> ways to control the target I send my messag
> I had another idea, but that is revert back to stupidity ;)
> using system and sending the output to a file then open the file ;)
Why not ? That's just fine
> What would be the easiest way to capture [stderr]?
One way:
$output = `$cmd 2>&1 1>$null`;
$null depends on the os; /dev/null on unix, /nul on an M$ OS.