How do you copy a file to multiple directories?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Thomas Cameron
Date:  
Subject: How do you copy a file to multiple directories?
----- Original Message -----
From: "Don Calfa" <>
To: <>
Sent: Monday, August 18, 2003 10:23 PM
Subject: How do you copy a file to multiple directories?


> I know there is a way to do this with *nix's superior scripting ability
> but I just don't know how.
>
> How can I copy a file to multiple subdirectories?
>
>
> I have a folder that has subdirectories and subdirectories and so on.
>
> /FolderA
> /FolderB1                                            /FolderB2
> /FolderC1_1    /FolderC1_2              /Folder C2_1

>
> I'm toying with gnump3d and I've got it working with PN (sort of) and I
> need to copy the password files to all the directories.


for i in directory1 directory2 directory3; do 
        cp myfile.txt /path/to/$i
done