V3/usr/man/man1/if.1

Find at most related files.
including files from this version of Unix.

.pa 1
.he 'IF (I)'3/15/72'IF (I)'
.ti 0
NAME		if --  conditional command
.sp
.ti 0
SYNOPSIS	if__ expr command [ arg918 ... ]
.sp
.ti 0
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____:

.in +9
.ti -4
-r__ file
.br
true if the file exists and is readable.

.ti -4
-w__ file
.br
true if the file exists and is writable

.ti -4
s1 =_ s2
.br
true if the strings s1__ and s2__ are equal.

.ti -4
s1 !=__ s2
.br
true if the strings s1__ and s2__ are not equal.

.in -9
These primaries may be combined with the
following operators:

.in +5
!_
.ti +4
unary negation operator

-a__
.ti +4
binary and___ operator

-o__
.ti +4
binary or__ operator

(_ expr )_
.ti +4
parentheses for grouping.

.in -5
-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.
.sp
.ti 0
FILES		--
.sp
.ti 0
SEE ALSO	sh(I)
.sp
.ti 0
DIAGNOSTICS	"if error",
if the expression has the wrong syntax;
"command not found."
.sp
.ti 0
BUGS		--