BSD 4_4 release
[unix-history] / usr / src / bin / test / test.1
index a347214..b4eaf0d 100644 (file)
@@ -1,13 +1,42 @@
-.\" Copyright (c) 1991 Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" %sccs.include.redist.roff%
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
 .\"
 .\"
-.\"     @(#)test.1     6.3 (Berkeley) %G%
+.\" 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.
 .\"
 .\"
-.Dd 
+.\" 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     8.1 (Berkeley) 5/31/93
+.\"
+.Dd May 31, 1993
 .Dt TEST 1
 .Dt TEST 1
-.Os BSD 4.4
+.Os
 .Sh NAME
 .Nm test
 .Nd condition evaluation utility
 .Sh NAME
 .Nm test
 .Nd condition evaluation utility
@@ -43,6 +72,10 @@ special file.
 True if
 .Ar file
 exists and is a directory.
 True if
 .Ar file
 exists and is a directory.
+.It Fl e Ar file
+True if
+.Ar file
+exists (regardless of type).
 .It Fl f Ar file
 True if
 .Ar file
 .It Fl f Ar file
 True if
 .Ar file
@@ -52,6 +85,10 @@ True if
 .Ar file
 exists and its set group ID flag
 is set.
 .Ar file
 exists and its set group ID flag
 is set.
+.It Fl h Ar file
+True if
+.Ar file
+exists and is a symbolic link.
 .It Fl n Ar string
 True if the length of
 .Ar string
 .It Fl n Ar string
 True if the length of
 .Ar string
@@ -187,7 +224,17 @@ The
 operator has higher precedence than the
 .Fl o
 operator.
 operator has higher precedence than the
 .Fl o
 operator.
-.Pp
+.Sh GRAMMAR AMBIGUITY
+The 
+.Nm test
+grammar is inherently ambiguous.  In order to assure a degree of consistency,
+the cases described in the 
+.St -p1003.2 , 
+section D11.2/4.62.4, standard
+are evaluated consistently according to the rules specified in the
+standards document.  All other cases are subject to the ambiguity in the
+command semantics.
+.Sh RETURN VALUES
 The
 .Nm test
 utility exits with one of the following values:
 The
 .Nm test
 utility exits with one of the following values:
@@ -204,5 +251,5 @@ An error occurred.
 The
 .Nm test
 function is expected to be
 The
 .Nm test
 function is expected to be
-.Tn POSIX
-1003.2 compatible.
+.St -p1003.2
+compatible.