From: Dan Stromberg on
On Thu, 17 Apr 2008 20:45:30 -0700, PRC wrote:

> Hi All,
> Is there a easy way in bash to pass the output of running CMD1 to 2 or
> more commands CMD2, CMD3, ... etc, without saving the output of CMD1 to
> a temporary file?
> It is no good saving the output in a varible since bash converts the
> tailing '\r's to spaces.
> The tranditional way looks like:
> CMD1>tmpfile
> CMD2<tmpfile
> CMD3<tmpfile
> ...
> CMDn<tmpfile
> rm -f tmpfile
>
>
> Best Regards,
> PRC
> Apr 18, 2008

This came up on the group recently - you might check the archives.

Anywaye, here's the option I like to use in my shell scripts:

http://stromberg.dnsalias.org/~strombrg/mtee.html