How do I pipe STDERR?
I do not want to redirect STDERR or STDOUT to a file. I want to 'pipe' std error through a filter (grep)
How do I grep the STDERR output of a commond without saving it to a file?
search in vain? Does bash/bash2 not have this ability? Is this ability simply not indexed on google? What search engine can find my answer?
Maybe /dev/null will help me in the current process
File descriptors
this is making a custom file descriptor with value three . this override the bash/shell default file descriptors. and save the current stdout value you can make it 4 6..9 .do not do 5 .
exec 3>&1execute your command and pipe it to grep command 2>&1 >&3 3>&- | grep word 3>&-
close the upper exec 3>&1 to resume work on your shell as defaults : exec 3>&-
Diaa Radwan
stderr must be one of the wor
stderr must be one of the worlds worst inventions..
That redirects stderr to stdout and stdout to /dev/null.
BTw, conceptor yours is appreciated and thank you for your plentiful information
I used to be indecisive .. but now I'm not so sure
For future refernce this is a
For future refernce this is a simpler way to do it (worked for me) command 2>$1 | grep word
(essentially the same but skips the extra fd by first redirecting stderr directly to stdout and then pipe it all to grep)
See http://www.teaser.fr/~ama
Essentialy, you need to know this command: foo >out 2>&1
which means "take stdout, put it in a file called out, and take stderr and put it at the same place stdout goes".
Down
link could not be found
I used to be indecisive .. but now I'm not so sure