I am trying to write a c-shell script that checks for number of arguments and echos a string, but I am getting an unexpected end of file syntax error and I don't understand why.
Here is what I tried:
if ( $#argv == 0 ) then
echo "Enter one or more args"
else
echo "Entry accepted"
endif
Later I tried to output each argument found with this:
if ( $#argv == 0 ) then
echo "Enter one or more args"
else
foreach arg ( $* )
echo "Found argument $arg"
end
endif
and got a different syntax error "unexpected token `('"
Any help is appreciated
bash
to interpret a csh script. The languages are different iin a number of ways. – Mark Plotnick Dec 13 '15 at 5:51csh foo.csh [ blah [ ..]]
– Archemar Dec 13 '15 at 8:58