Unix |
Unix v6 |
|
![]() |
if(1) |
![]() |
if conditional command expr command [ arg ... ] evaluates the expression and if its value is true, executes the given with the given arguments. The following primitives are used to construct the r file true if the file exists and is readable. w file true if the file exists and is writable. s1 = s2 true if the strings and are equal. s1 != s2 true if the strings and are not equal. { command } The bracketed command is executed to obtain the exit status. Status zero is considered The command must not be another These primaries may be combined with the following operators: ! unary negation operator a binary operator o binary operator ( expr ) parentheses for grouping. has higher precedence than Notice that all the operators and flags are separate arguments to and hence must be surrounded by spaces. Notice also that parentheses are meaningful to the Shell and must be escaped. sh (I), find (I)
![]() |
if(1) | ![]() |