Unfortunately, you cannot have a one line for loop in C-shell scripting. The best you can do is create a script file, if you commonly use it.
foreach file (*.com)
mv $file /home/Scratch/$file
end
문제
The following bash for
loop iterates over every file in a directory, moving it to a new location:
for file in *.com; do mv $file /home/Scratch/$file; done
What would be the equivalent for the C shell?
해결책
Unfortunately, you cannot have a one line for loop in C-shell scripting. The best you can do is create a script file, if you commonly use it.
foreach file (*.com)
mv $file /home/Scratch/$file
end