variable assignment find -name output csh
Greetings fellow Linux users! I use Linux regularly, but I am still learning!
I am trying to move a bunch of files that are in nested sub directories into one common folder. They all end in .dcm. To do this in the past I have done the following:
foreach sub (subject1 subject2 . . .subjectn)
pushd $sub
mkdir common_folder
set files = (`find ./ -name "*dcm"`)
mv $files ./common_folder
popd
end
For some reason this is only working for a portion of the subjects. For the others, this is happening:
set: No match
But when I'm in that subject's directory and execute
find ./ -name "*dcm" (no tilted quotes, var assignment, etc)
I see a list of the files I want to move and their paths. So then I do this:
set files = (`find ./ -name "*dcm"`)
and I get
set: No match.
I have tried the following:
set dcms = "*dcm"
set files = (`find ./ -name "${dcms}"`)
set files = (find ./ -name "${dcms}")
set files = `find ./ -name "${dcms}"`
set files = (`find ./ -name \*dcm`)
set files = ( `find ./ -name "*dcm" -print` )
set files = ( `find ./ -print -name "*dcm"` )
set files = (`find ./ -print`)
What, pray tell, am I missing?