ifif
Begin a conditional statement. The simple format is: if (expr ) cmd There are three other possible formats, shown side-by-side:
In the simplest form, execute cmd
if expr
is true; otherwise, do nothing (redirection still occurs; this is a bug). In the other forms, execute one or more commands. If expr
is true, continue with the commands after ExampleTake a default action if no command-line arguments are given: if ($#argv == 0) then echo "No filename given. Sending to Report." set outfile = Report else set outfile = $argv[1] endif |
|