IF(I) 3/15/72 IF(I)
NAME
if - conditional command
SYNOPSIS
if expr command [ arg ... ]
DESCRIPTION
If evaluates the expression expr, and if its value is true,
executes the given command with the given arguments.
The following primitives are used to construct the expr:
-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 s1 and s2 are equal.
s1 != s2 true if the strings s1 and s2 are not equal.
These primaries may be combined with the following
operators:
! unary negation operator
-a binary and operator
-o binary or operator
( expr ) parentheses for grouping.
-a has higher precedence than -o. Notice that all the
operators and flags are separate arguments to if and hence
must be surrounded by spaces. Notice also that parentheses
are meaningful to the Shell and must be escaped.
SEE ALSO
sh(I)
BUGS