-.TH TEST 1 ""
-.AT 3
-.SH NAME
-test \- condition command
-.SH SYNOPSIS
-.B test
-expr
-.SH DESCRIPTION
-.I test
-evaluates the expression
-.IR expr ,
-and if its value is true then returns zero exit status; otherwise, a
-non zero exit status is returned.
-.I test
-returns a non zero exit if there are no arguments.
-.PP
-The following primitives are used to construct
-.IR expr .
-.TP 9n
-.BR \-r " file"
-true if the file exists and is readable.
-.TP
-.BR \-w " file"
-true if the file exists and is writable.
-.TP
-.BR \-f " file"
-true if the file exists and is not a directory.
-.TP
-.BR \-d " file"
-true if the file exists exists and is a directory.
-.TP
-.BR \-s " file"
-true if the file exists and has a size greater than zero.
-.TP
-.BR \-t " [ fildes ]"
-true if the open file whose file descriptor number is
-.I fildes
-(1 by default)
-is associated with a terminal device.
-.TP
-.BR \-z " s1"
-true if the length of string
-.I s1
-is zero.
-.TP
-.BR \-n " s1"
-true if the length of the string
-.I s1
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)test.1 6.5 (Berkeley) 8/6/91
+.\"
+.Dd August 6, 1991
+.Dt TEST 1
+.Os
+.Sh NAME
+.Nm test
+.Nd Condition evaluation utility.
+.Sh SYNOPSIS
+.Nm test
+.Ar expression
+.Sh DESCRIPTION
+The
+.Nm test
+utility evaluates the expression and, if it evaluates
+to true, returns a zero (true) exit status; otherwise
+it returns 1 (false).
+If there is no expression, test also
+returns 1 (false).
+.Pp
+All operators and flags are separate arguments to the
+.Nm test
+utility.
+.Pp
+The following primaries are used to construct expression:
+.Bl -tag -width Ar
+.It Fl b Ar file
+True if
+.Ar file
+exists and is a block special
+file.
+.It Fl c Ar file
+True if
+.Ar file
+exists and is a character
+special file.
+.It Fl d Ar file
+True if
+.Ar file
+exists and is a directory.
+.It Fl f Ar file
+True if
+.Ar file
+exists and is a regular file.
+.It Fl g Ar file
+True if
+.Ar file
+exists and its set group ID flag
+is set.
+.It Fl n Ar string
+True if the length of
+.Ar string