Reputation: 221
Does a csh or a C shell script have a for
loop or does it only have a foreach
loop?
Can I do the following?
for($i=11; $i<=24; $i++)
{
echo $i
}
Upvotes: 0
Views: 2294
Reputation: 567
No, there is no for
-only loop.
However, to obtain similar results, you can use a while loop:
#!/bin/csh
set j = 11
while ( $j <= 24 )
echo $j
@ j++
end
Upvotes: 2