.TH TEST 1 "January 1988" "Korn shell"
.ta 30n
.de X
.br
\\$1	\\$2
..
.SH NAME
test \- test condition (Korn and 8th edition)
.SH SYNOPSIS
\fBtest\fP \fIexpression\fP
.br
\fB[\fP \fIexpression\fP \fB]\fP
.SH DESCRIPTION
\fBTest\f evaluates the \fIexpression\fP and returns zero status if true,
and non-zero status otherwise.
It is normally used as the controlling command of the \fBif\fP and \fBwhile\fP statements.
.LP
The following basic expressions are available.
.IP
.X "-r file" "file exists and is readable"
.X "-w file" "file exists and is writable"
.X "-x file" "file exists and is executable"
.X "-f file" "file is a regular file"
.X "-d file" "file is a directory"
.X "-c file" "file is a character special device"
.X "-b file" "file is a block special device"
.X "-p file" "file is a named pipe"
.X "-u file" "file mode has setuid bit"
.X "-g file" "file mode has setgid bit"
.X "-k file" "file mode has sticky bit"
.X "-s file" "file is not empty"
.X "-L file" "file is a symbolic link"
.X "-S file" "file is a socket"
.X "file -nt file" "first file is newer than second file"
.X "file -ot file" "first file is older than second file"
.X "file -ef file" "first file is the same file as second"
.X "-t filedes" "file descriptor is a tty device"
.IP
.X "string" "string is not null"
.X "-z string" "string is null"
.X "-n string" "string is not null"
.X "string = string" "strings are equal"
.X "string != string" "strings are not equal"
.IP
.X "number -eq number" "numbers compare equal"
.X "number -ne number" "numbers compare not equal"
.X "number -ge number" "numbers compare greater than or equal"
.X "number -gt number" "numbers compare greater than"
.X "number -le number" "numbers compare less than or equal"
.X "number -lt number" "numbers compare less than"
.LP
The above basic expressions may be combined with the following operators.
.IP
.X "expr -o expr" "logical or"
.X "expr -a expr" "logical and"
.X "! expr" "logical not"
.X "( expr )" "grouping"
.SH AUTHOR
Erik Baalbergen. Modified by Arnold Robbins.
