Aug 05 2008

stdout, stdin

Tag: Perlberrisch @ 3:45 pm


Howto redirect the standard input and output of a command shell script:

STDERR and STDOUT together:

    $output = `cmd 2>&1`;

To capture a command’s STDOUT but discard its STDERR:

    $output = `cmd 2>/dev/null`;

To capture a command’s STDERR but discard its STDOUT (ordering is important here):

    $output = `cmd 2>&1 1>/dev/null`;

To exchange a command’s STDOUT and STDERR in order to capture the STDERR but leave its STDOUT to come out the old STDERR:

    $output = `cmd 3>&1 1>&2 2>&3 3>&-`;

To read both a command’s STDOUT and its STDERR separately, it’s easiest to redirect them separately to files, and then read from those files when the program is done:

    system("program args 1>program.stdout 2>program.stderr");

Aug 04 2008

My Homer Maharadscha

Tag: Outter Worldberrisch @ 4:57 pm

Posted by mobile phone:
TDMDAJM
This little Homer is smiling to me each morning
in my little office in Paris!
File info:
Type: image jpg
Size: 228.30 kb
Homer Maharadscha