Copying one file to different destinations.

  • Follow


Hi.

I am having some problems with the cp-routine. It doesn't copy one file to multiple destinations. 

I want to do something like this; cp myfile.txt ~/directory1/thisfile.txt ~/directory2/thatfile.txt ; copy myfile.txt to ~/directory<1,2>. 
BUT....there is always a but.....I want to read from my disk only ONCE, and not twice. If I wanted to read the disk twice, I would make a bash-script. 

How can this be solved? I'm reading the source of cp.c and copy.c in coreutils. 
Rewritting cp.c, and copy.c is a bad and slow solution how to solve this problem. 
How could this be solved in a easy, and clever way?

Best Regards, 

Ole J. 
0
Reply waterthrill (6) 10/12/2003 4:39:29 PM

Please don't multipost and keep your lines less than 80
character long (preferably 65 as per RFC 1855)

Your question was already answered in comp.unix.question

-- 
St�phane
0
Reply Stephane 10/12/2003 3:36:19 PM


cat i | tee o1 | tee o2 | tee o3 > o4

Ole Jacob Hagen wrote:
> 
> Hi.
> 
> I am having some problems with the cp-routine. It doesn't copy one file to multiple destinations.
> 
> I want to do something like this; cp myfile.txt ~/directory1/thisfile.txt ~/directory2/thatfile.txt ; copy myfile.txt to ~/directory<1,2>.
> BUT....there is always a but.....I want to read from my disk only ONCE, and not twice. If I wanted to read the disk twice, I would make a bash-script.
> 
> How can this be solved? I'm reading the source of cp.c and copy.c in coreutils.
> Rewritting cp.c, and copy.c is a bad and slow solution how to solve this problem.
> How could this be solved in a easy, and clever way?
> 
> Best Regards,
> 
> Ole J.
0
Reply Lorinczy 10/13/2003 5:40:41 PM

Lorinczy Zsigmond / Domonyik Mariann wrote:
> cat i | tee o1 | tee o2 | tee o3 > o4

tee < i o1 o2 o3 > o4

As already said in the multiple newsgroups this question was
multiposted to.

-- 
St�phane
0
Reply Stephane 10/13/2003 7:34:33 PM

3 Replies
579 Views

(page loaded in 0.077 seconds)

Similiar Articles:













7/22/2012 6:45:14 AM


Reply: