[NTLUG:Discuss] Output to Multiple Files

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 7 09:06:30 CDT 2005


On Thu, Apr 07, 2005 at 06:30:45AM -0700, David Wilson wrote:
> My understanding is that Tee outputs to Standard out
> (monitor) and a file but not to two files.  

The versions of tee(1) that I have allow output to multiple files.
But even if your version of tee(1) only goes to a file and 
standard output, one can redirect standard output to a file:

    dd if=/dev/floppy of=- | tee file1 > file2

or for those who like to throw in gratuitous processes

    dd if=/dev/floppy of=- | tee file1 | cat >file2

or for those with older versions of tee and who want to go to three files

    dd if=/dev/floppy of=- | tee file1 | tee file2  >file3

Pm


> --- Fred James <fredjame at fredjame.cnc.net> wrote:
> > David Wilson wrote:
> > 
> > >I am looking for a little help in finding a tool
> > that
> > >will let me send the output of an script into to
> > >simultaneous file locations.  For example,  I will
> > >read in the contents of a floppy diskette using dd,
> >  I
> > >would like the out put to go to two different
> > >locations at the same time.  At the present time, 
> > I
> > >have to run the command twice, once for each
> > location.
> > > I also read in large hard drive volumes using dd
> > so
> > >simply making a copy of the dd image file is not a
> > >solution since it takes too much time.
> > >
> > >Any suggestions?
> > >
> > >Thanks
> > >
> > >
> > >David
> > >  
> > >
> > David Wilson
> > Will "tee" work for you?
> > Regards
> > Fred James
> > 
> > -- 
> > Compassion alone stands apart from the continuous
> > traffic between good and evil proceeding within us. 
> > "Om Mani Padme Hum"
> > 
> > 
> > _______________________________________________
> > https://ntlug.org/mailman/listinfo/discuss
> > 
> 
> 
> 		
> __________________________________ 
> Yahoo! Messenger 
> Show us what our next emoticon should look like. Join the fun. 
> http://www.advision.webevents.yahoo.com/emoticontest
> 
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list