Testing for Conditions
When writing scripts, you frequently want to test for conditions. The simplest test is to determine whether a condition is true or false. If the expression is true, execute any subsequent commands (shown indented in Table 90); if not, continue with the script. Table 90 shows the syntax for conditional tests.
|Bourne and Korn Shells||C Shell|
if command then commands elif command commands else commands fi
if (cond) then commands else if (cond) then commands else commands endif
For the Bourne and Korn shells, use the if-then-else-elif-fi syntax to test for conditions. You can follow the if statement with the test command and its argument(s) to test for conditions. ...