[X-Unix] Copying to multiple directories

Kuestner, Bjoern Bjoern.Kuestner at drkw.com
Thu Mar 11 00:08:25 PST 2004


Uh, ah, I don't exactly understand how Brian's solution works (it is a
solution, Brian, right?), and I hesitate to run any command that I don't
understand "just to find out". (c:

(It's this "echo" that confuses me ... I would have expected something like
"exec" or ` `? And then there are no ' ' or " " afterwards for what is
handed to "echo"?)

But Harvey, the problem with your command is that you command expands to:

cp -r fileA /Users/john/Library /Users/mary/Library /Users/liz/Library

cp accepts the last parameter alone as the target!

Another note: For just one file you don't need "-r".

But since you do have "-r", I would have expected this to copy file A,
john's Library and mary's Library all to liz' Library. Can anybody explain
why (according to Harvey) that isn't happening?

Also, Harvey, be aware that with using cp you're losing all information in
the resource fork. Bad for OS 9 apps, images with previews and other things.

Alternatives are the commands CpMac and ditto:
http://www.westwind.com/reference/OS-X/commandline/files-folders.html

Bjorn


--------------------


--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender.
--------------------------------------------------------------------------------



More information about the X-Unix mailing list