How to write a script?
How do you write a script that will read in a list of directories and then copy a set of files in to each of the directories that it read in from the list? System in Cent OS 5 latest version.
Thank you for your help in advance. |
Try working your way through a simple scripting tutorial. I recommend Linuxcommand.org.
What you're asking is very simple; just a "for" loop to iterate through your list and run the copy command on the directory name. |
The absolute best way to learn scripting is to first experiment with the basic commands---one at a time.
In this case, I think you are saying you have a file with a list of directory names---let's call it "namefile". First, try: Code:
read name < namefile Code:
while read name; do echo $name; done < namefile |
Thank you
thank you for your reply
|
All times are GMT -5. The time now is 08:45 AM. |