Link to home
Start Free TrialLog in
Avatar of wademi
wademi

asked on

How do I declare c shell variables with a list of directory paths and use them in foreach

How do I declare c shell variables with a list of directory paths ?

I tried the following but I dont think its correct.

set DestDir[1] = /home/milligram/MyVideos/In
set DestDir[2] = /home/milligram/MyVideos/Is
set DestDir[3] = /home/milligram/MyVideos/IT
set DestDir[4] = /home/milligram/MyVideos/Ho
set DestDir[5] = /home/milligram/MyVideos/FM)
#set DestDir = (/home/milligram/MyVideos/In /home/milligram/MyVideos/Is /home/milligram/MyVideos/Ho /home/milligram/MyVideos/FM /home/milligram/MyVideos/IT)


how do I execute foreach loops with the paths?

Is this corret?

foreach dest ($DestDir)

echo $dest

end
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial