John McKown wrote:
Is there any better way, in a bash script, to pipe both stdout and stderr
from an application other than using a subshell? So far the only way that
I've thought of to do it is:
(command parm1 ... 2>&1) | othercommand
The parentheses don't do anything useful. Here, stderr is discarded (by
cat) in the first example, but not the second.
01:46 [sum...@numbat ~]$ find ~ -size +40000000000c 2>&1 | cat >/dev/null
01:47 [sum...@numbat ~]$ find ~ -size +40000000000c | cat >/dev/null
find: /home/summer/newstocks: Permission denied
find: /home/summer/mystocks: Permission denied
find: /home/summer/stocks: Permission denied
01:47 [sum...@numbat ~]$
--
Cheers
John
-- spambait
1aaaa...@coco.merseine.nu z1aaaa...@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375
You cannot reply off-list:-)
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390