[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Copying files ..



On 23/01/2004, at 10:52, Williamson, Glenn wrote:

> Hey,
>
> I'm copying every file from a directory into another directory, but I 
> want
> to stick a prefix in the target file name. i.e.:
>
>     "cp /temp/* /Users/glenn/"
>
> .. But if /temp contained: "foo", "bar", "bum", I want the destination 
> files
> to be called "temp-foo", "temp-bar", "temp-bum". Anyone know how to do 
> this?
>
>   gleNN
>

ls /temp | xargs -i cp /temp/{} Users/glenn/temp-{}

cheers,
Andi.


-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@nospam.progsoc.uts.edu.au.
If you are having trouble, ask owner-progsoc@nospam.progsoc.uts.edu.au for help.