in reply to Output redirection -- hard

i've had a lot of problems handling output when using the system command so normally i'll just use the back ticks to execute a command from the command line.

for example

$string = `command 2>/dev/null`;

puts the output of the command into string and the error code into /dev/null

or simply `command >/dev/null`;

*notice* - those are backticks, not apostrophe's

Replies are listed 'Best First'.
Re: Re: Output redirection -- hard
by physi (Friar) on Aug 07, 2001 at 10:46 UTC
    Additional you can use $? to get the error code from your backtics command.
    ----------------------------------- --the good, the bad and the physi-- -----------------------------------