Linux variables with cp command
Hello,
I have a .img file in multiple folders that I would like to copy to a new folder. For subject 301_A, for example, the file I want to copy is 301_A_mpflash.img. There are similar files in the same folder, such as r301_A_mpflash.img, that I don't want to copy so I need to be specific.
Below is a small part of the script that I wrote to accomplish this, however, I get an error with the $subject_mpflash.img portion. So in general, how can you use a variable in this kind of situation? Any help would be greatly appreciated.
Thanks,
David
for subject in 301_A 301_B 302_A
do
cp /data/$subject/Anatomy/$subject_mpflash.img /data/group/$subject/
done
|