chris01010
Programmer
I am currently writing a script where it is necessary to copy a number of files to a number of directories and I want to do it re-using 1 if statement, what I don't want is to copy all of the files to all the directories.
Basically I want the script to look at the first variable (being the filename) and the second variable (namely the directory)then execute the if statement which copies the file to the directory. Then loop to the next set of filenames and directories and repeat the if statement.
I have managed to get as far as having all files being copied to each of the directories that it loops through.
Does anyone have any suggestions on how to get the desired result?
Basically I want the script to look at the first variable (being the filename) and the second variable (namely the directory)then execute the if statement which copies the file to the directory. Then loop to the next set of filenames and directories and repeat the if statement.
I have managed to get as far as having all files being copied to each of the directories that it loops through.
Does anyone have any suggestions on how to get the desired result?