test.1 (68875) | test.1 (68935) |
---|---|
1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the Institute of Electrical and Electronics Engineers, Inc. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)test.1 8.1 (Berkeley) 5/31/93 | 1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" the Institute of Electrical and Electronics Engineers, Inc. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" @(#)test.1 8.1 (Berkeley) 5/31/93 |
36.\" $FreeBSD: head/bin/test/test.1 68875 2000-11-18 14:44:30Z ru $ | 36.\" $FreeBSD: head/bin/test/test.1 68935 2000-11-20 11:39:41Z ru $ |
37.\" 38.Dd May 31, 1993 39.Dt TEST 1 40.Os 41.Sh NAME 42.Nm test , 43.Nm \&[ 44.Nd condition evaluation utility 45.Sh SYNOPSIS | 37.\" 38.Dd May 31, 1993 39.Dt TEST 1 40.Os 41.Sh NAME 42.Nm test , 43.Nm \&[ 44.Nd condition evaluation utility 45.Sh SYNOPSIS |
46.Nm test | 46.Nm |
47.Ar expression 48.Nm \&[ 49.Ar expression Cm ] 50.Sh DESCRIPTION 51The | 47.Ar expression 48.Nm \&[ 49.Ar expression Cm ] 50.Sh DESCRIPTION 51The |
52.Nm test | 52.Nm |
53utility evaluates the expression and, if it evaluates 54to true, returns a zero (true) exit status; otherwise 55it returns 1 (false). 56If there is no expression, test also 57returns 1 (false). 58.Pp 59All operators and flags are separate arguments to the | 53utility evaluates the expression and, if it evaluates 54to true, returns a zero (true) exit status; otherwise 55it returns 1 (false). 56If there is no expression, test also 57returns 1 (false). 58.Pp 59All operators and flags are separate arguments to the |
60.Nm test | 60.Nm |
61utility. 62.Pp 63The following primaries are used to construct expression: 64.Bl -tag -width Ar 65.It Fl b Ar file 66True if 67.Ar file 68exists and is a block special --- 214 unchanged lines hidden (view full) --- 283.Pp 284The 285.Fl a 286operator has higher precedence than the 287.Fl o 288operator. 289.Sh GRAMMAR AMBIGUITY 290The | 61utility. 62.Pp 63The following primaries are used to construct expression: 64.Bl -tag -width Ar 65.It Fl b Ar file 66True if 67.Ar file 68exists and is a block special --- 214 unchanged lines hidden (view full) --- 283.Pp 284The 285.Fl a 286operator has higher precedence than the 287.Fl o 288operator. 289.Sh GRAMMAR AMBIGUITY 290The |
291.Nm test | 291.Nm |
292grammar is inherently ambiguous. In order to assure a degree of consistency, 293the cases described in the 294.St -p1003.2 , 295section D11.2/4.62.4, standard 296are evaluated consistently according to the rules specified in the 297standards document. All other cases are subject to the ambiguity in the 298command semantics. 299.Sh RETURN VALUES 300The | 292grammar is inherently ambiguous. In order to assure a degree of consistency, 293the cases described in the 294.St -p1003.2 , 295section D11.2/4.62.4, standard 296are evaluated consistently according to the rules specified in the 297standards document. All other cases are subject to the ambiguity in the 298command semantics. 299.Sh RETURN VALUES 300The |
301.Nm test | 301.Nm |
302utility exits with one of the following values: 303.Bl -tag -width Ds 304.It 0 305expression evaluated to true. 306.It 1 307expression evaluated to false or expression was 308missing. 309.It >1 310An error occurred. 311.El 312.Sh SEE ALSO 313.Xr expr 1 , 314.Xr sh 1 315.Sh STANDARDS 316The | 302utility exits with one of the following values: 303.Bl -tag -width Ds 304.It 0 305expression evaluated to true. 306.It 1 307expression evaluated to false or expression was 308missing. 309.It >1 310An error occurred. 311.El 312.Sh SEE ALSO 313.Xr expr 1 , 314.Xr sh 1 315.Sh STANDARDS 316The |
317.Nm test | 317.Nm |
318utility implements a superset of the 319.St -p1003.2 320specification. | 318utility implements a superset of the 319.St -p1003.2 320specification. |