.\" Copyright (c) 1991 Regents of the University of California.
.\" %sccs.include.redist.roff%
.\" @(#)test.1 6.3 (Berkeley) %G%
.Nd Condition evaluation utility.
utility evaluates the expression and, if it evaluates
to true, returns a zero (true) exit status; otherwise
If there is no expression, test also
All operators and flags are separate arguments to the
The following primaries are used to construct expression:
exists and is a block special
exists and is a character
exists and is a directory.
exists and is a regular file.
exists and its set group ID flag
.Ar file exists and is readable.
exists and has a size greater
.It Fl t Ar [file_descriptor]
True if the file whose file descriptor number
(default 1) is open and is
associated with a terminal.
exists and its set user ID flag
indicates only that the write flag is on.
The file is not writable on a read-only file
system even if this test indicates true.
exists and is executable.
indicates only that the execute flag is on.
is a directory, true indicates that
.It Ar \&s\&1 Cm \&= Ar \&s\&2
.It Ar \&s\&1 Cm \&!= Ar \&s\&2
.It Ar \&n\&1 Fl \&eq Ar \&n\&2
.It Ar \&n\&1 Fl \&ne Ar \&n\&2
.It Ar \&n\&1 Fl \> Ar \&n\&2
.It Ar \&n\&1 Fl \&ge Ar \&n\&2
greater than or equal to the integer
.It Ar \&n\&1 Fl \< Ar \&n\&2
.It Ar \&n\&1 Fl \&le Ar \&n\&2
than or equal to the integer
These primaries can be combined with the following operators:
.It Ar expression1 Fl a Ar expression2
.It Ar expression1 Fl o Ar expression2
.It Cm \&( Ns Ar expression Ns Cm \&)
True if expression is true.
operator has higher precedence than the
utility exits with one of the following values:
expression evaluated to true.
expression evaluated to false or expression was
function is expected to be