with tcsh, I want to print "Hello" for each x,y, z, e, and f. But with the following script, it only prints x. Can someone tell me how to print "Hello" also for y, z, e, and f?
#! /bin/tcsh -f
set arr=(x y z e f)
set j = 0
foreach i ($arr)
echo $i
while ($j < 5)
echo "Hello"
@ j++
end
end
The result is:
x
Hello
Hello
Hello
Hello
Hello
y
z
e
f