devnul has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm really at a loss on the best way to approach this silly problem. I have a command-line program that does not properly generate exit codes (the source code for which is unavailable, so it can't be fixed).
Over the years, I've grown accustomed to using this nomenclature when executing an external command:
Unfortunately, the piece of data I need to grab to see if the command has failed is being sent to STDERR, not STDOUT.
For the life of me, I cannot seem to find a way to get the 3+argument version of open to give me what is going to STDOUT.
Alternatively, I am happy to go back to the 2-argument version, but how can I ensure that the filename I am passing in gets through the shell ok?...
...I've been up all night, so I apologize if this seems silly...
- dEvNuL
I'm really at a loss on the best way to approach this silly problem. I have a command-line program that does not properly generate exit codes (the source code for which is unavailable, so it can't be fixed).
Over the years, I've grown accustomed to using this nomenclature when executing an external command:
(where $filename is usually something grabbed from readdir, so it may contain spaces, etc)..open(PIPE, '-|', $somecommand, $arg1, $arg2, ..., $arg(N), $filanem);
Unfortunately, the piece of data I need to grab to see if the command has failed is being sent to STDERR, not STDOUT.
For the life of me, I cannot seem to find a way to get the 3+argument version of open to give me what is going to STDOUT.
Alternatively, I am happy to go back to the 2-argument version, but how can I ensure that the filename I am passing in gets through the shell ok?...
...I've been up all night, so I apologize if this seems silly...
- dEvNuL
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Pipe, STDERR, STDOUT, and friends
by ikegami (Patriarch) on Sep 21, 2008 at 21:00 UTC | |
Re: Pipe, STDERR, STDOUT, and friends
by moritz (Cardinal) on Sep 21, 2008 at 20:26 UTC | |
Re: Pipe, STDERR, STDOUT, and friends
by repellent (Priest) on Sep 22, 2008 at 03:22 UTC | |
Re: Pipe, STDERR, STDOUT, and friends
by gloryhack (Deacon) on Sep 22, 2008 at 08:04 UTC | |
Re: Pipe, STDERR, STDOUT, and friends
by xdg (Monsignor) on Sep 22, 2008 at 12:36 UTC | |
Re: Pipe, STDERR, STDOUT, and friends
by Anonymous Monk on Sep 21, 2008 at 20:29 UTC |
Back to
Seekers of Perl Wisdom