How to loop(Iterate) through List with foreach(csh)

Hey all,,

I know cshell is harmful:) but I am using this just "to know" - for educational purposes!... not for a long-term use.

lets say i have a list..

set arr=(x y z e f)

I wanna iterate the list with foreach ,, not with while.!!

foreach i $arr
echo $i
end

does not work

please do not give me a solution with while because I already know it.
I am only interested in foreach loop

thanks

set arr=(x y z e f) 
foreach i ($arr) 
echo $i 
end
1 Like

easy & fast :slight_smile:

thank you xbin:)