Re: zsh: How to selectively filter stderr?
2008-09-16, 17:16(+00), kj:
Is there a way to filter some errors from a command's error stream
while leaving other errors undisturbed?
I know that, in zsh at least, I can do something like
% frobozz |& grep -v 'error to discard'
But this has the effect of mixing up both stderr and stdout, which
I don't want to do. Is there a way to filter stderr error selectively,
without merging it with stdout?
[...]
{ frobozz 2>&1 >&3 | grep -v 'error to discard' >&2; } 3>&1
With any Bourne-like shell (like zsh).
--
Stéphane
.
Relevant Pages
- Re: Output to file
... > Perhaps the output is going to stderr instead of stdout. ... Only with bash. ... zsh)). ... (comp.unix.shell) - equivalent zsh syntax for bash command
... I'd like the stdout of a command to go to a file & the stderr to be ... How do I perform the equivalent command in zsh? ... (comp.unix.shell) - FAQ 8.25 How can I capture STDERR from an external command?
... This message is one of several periodic postings to comp.lang.perl.misc ... both STDOUT and STDERR will go the same place as the ... script's STDOUT and STDERR, unless the systemcommand redirects them. ... You can also use file-descriptor redirection to make STDERR a duplicate ... (comp.lang.perl.misc) - FAQ 8.25 How can I capture STDERR from an external command?
... This message is one of several periodic postings to comp.lang.perl.misc ... both STDOUT and STDERR will go the same place as the ... script's STDOUT and STDERR, unless the systemcommand redirects them. ... You can also use file-descriptor redirection to make STDERR a duplicate ... (comp.lang.perl.misc) - FAQ 8.25 How can I capture STDERR from an external command?
... This message is one of several periodic postings to comp.lang.perl.misc ... both STDOUT and STDERR will go the same place as the ... script's STDOUT and STDERR, unless the systemcommand redirects them. ... You can also use file-descriptor redirection to make STDERR a duplicate ... (comp.lang.perl.misc) |
|