Re: cat output to two files?

From: Dances With Crows (danSPANceswitTRAPhcrows_at_usa.net)
Date: 02/23/04


Date: 23 Feb 2004 21:40:58 GMT

On Mon, 23 Feb 2004 16:08:22 -0500, Stuart Herd staggered into the Black
Sun and said:
> On Mon, 23 Feb 2004 21:19:42 +0100, Uli Wachowitz wrote:
>> Stuart Herd <sherd@ca.inter.net1> wrote:
>>> I need to have the output go to 2 and 3
>>> #cat 1 >2 >3
>>> This obviously does not work as it is already in 2
>> what about 'tee'?
>> cat 1 | tee 2 > 3
> perhaps i shouldn't have used cat to illustrate my example. :-) I am
> trying to get the output of a command into two different log files

What makes you think the standard output from cat is any different from
the standard output from any other command? tee works with anything
that writes to stdout--it'd be pretty bloody useless if it didn't.

> convert "${files}" -resize 800x600 -colorspace rgb "${files}.jpg"
> >>$RESULTS >>$log

convert "{$files}" -foo -bar "${files}.jpg" | tee -a $RESULTS >> $LOG

This looks more complicated than what Uli wrote, but it's conceptually
the same. HTH,

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /                Hire me! 
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume


Relevant Pages

  • Re: cat output to two files?
    ... Stuart Herd wrote: ... >>what about 'tee'? ... > I am trying to get the output of a command into two different log files ... > From the following i would need the results of the convert command to be ...
    (comp.os.linux.misc)
  • Re: tee command
    ... The tee(1) command copies everything from it's standard input ... to both it's standard output, and to each file named in it's arguments. ...
    (comp.unix.shell)
  • Re: tee command
    ... The tee(1) command copies everything from it's standard input ... to both it's standard output, and to each file named in it's arguments. ...
    (comp.unix.shell)
  • Re: Howto parse stdout without changing it
    ... > I would like to parse stdout from a command list but also piped stdout to ... I guess you are looking for `tee`. ... echo "gzip result: $" ...
    (comp.unix.shell)
  • Re: How to get text from a graphic image
    ... > I took a screen snapshot of a terminal window ... go and take a look at the redirection options in bash or whatever shell ... Output from a command ... In most cases if all you want is the standard output from a command logged ...
    (Fedora)