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/I n
set DestDir[2] = /home/milligram/MyVideos/I s
set DestDir[3] = /home/milligram/MyVideos/I T
set DestDir[4] = /home/milligram/MyVideos/H o
set DestDir[5] = /home/milligram/MyVideos/F M)
#set DestDir = (/home/milligram/MyVideos/ In /home/milligram/MyVideos/I s /home/milligram/MyVideos/H o /home/milligram/MyVideos/F M /home/milligram/MyVideos/I T)
how do I execute foreach loops with the paths?
Is this corret?
foreach dest ($DestDir)
echo $dest
end
I tried the following but I dont think its correct.
set DestDir[1] = /home/milligram/MyVideos/I
set DestDir[2] = /home/milligram/MyVideos/I
set DestDir[3] = /home/milligram/MyVideos/I
set DestDir[4] = /home/milligram/MyVideos/H
set DestDir[5] = /home/milligram/MyVideos/F
#set DestDir = (/home/milligram/MyVideos/
how do I execute foreach loops with the paths?
Is this corret?
foreach dest ($DestDir)
echo $dest
end
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www-cs.canisius.edu/ONLINESTUFF/UNIX/shellprogramming.html#M
http://www.grymoire.com/Unix/Csh.html#uh-22