If statement - tcsh
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 |
The if statement needs spaces,
e.g. if($scen == a) then |
All times are GMT -5. The time now is 11:58 PM. |