[NTLUG:Discuss] Output to Multiple Files

Fred James fredjame at fredjame.cnc.net
Thu Apr 7 09:19:07 CDT 2005


David Wilson wrote:

>My understanding is that Tee outputs to Standard out
>(monitor) and a file but not to two files.  
>
>
>--- 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
>>
>>    
>>
David Wilson
The man page says:
"TEE(1)                           User Commands                          
TEE(1)
 
NAME
       tee - read from standard input and write to standard output and files
 
"
therefore, for example:
who | tee filename_1 filename_1
sends the results of 'who' to STDOUT, and to two files (filename_1 and 
filename_2).
I haven't tried this myself, but that's what the man page says, and 
"UNIX in a Nutshell" agrees.
Hope this helps.
Regards
Fred James

-- 
Compassion alone stands apart from the continuous traffic between good and evil proceeding within us.  "Om Mani Padme Hum"





More information about the Discuss mailing list