9

If statement - tcsh

view full story
linux-howto

http://www.linuxquestions.org – I need to loop through a bunch of different scenarios (variable scen), but can't figure out how to use the if statements in the tcsh shell script. Getting the error "if: Expression Syntax" Can someone please tell me what I have wrong? Simplified code follows! Thanks! #!/bin/tcsh -f # set val = 0 foreach scen ( a b ) echo $scen if ($scen==a) then echo $scen else echo $val endif end (HowTos)