初学者的shell问题 -- foreach或while并没有循环,请大家帮忙!
sample 1:
foreach backfile ( *.c )
echo $backfile
end
sample 2:
et NameArray = ( test.java test.cxx test.hxx )
@ size=$#NameArray
@ index=1
set name = default
while ( $index < $size )
set name = $NameArray[$index]
echo $index
echo $size
@ index++
echo "name : $name"
end
两个sample均只能打印循环的第一项,请大家帮忙看看!