Module Name: src Committed By: joerg Date: Mon May 24 00:29:30 UTC 2010
Modified Files: src/bin/expr: expr.1 Log Message: Explicitly quote | and : meant as separate operator. Kill trailing whitespace. Don't use \Z' with obscure character entity. Reorder sections to canonical order. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/bin/expr/expr.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/expr/expr.1 diff -u src/bin/expr/expr.1:1.29 src/bin/expr/expr.1:1.30 --- src/bin/expr/expr.1:1.29 Wed Apr 30 13:10:46 2008 +++ src/bin/expr/expr.1 Mon May 24 00:29:30 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: expr.1,v 1.29 2008/04/30 13:10:46 martin Exp $ +.\" $NetBSD: expr.1,v 1.30 2010/05/24 00:29:30 joerg Exp $ .\" .\" Copyright (c) 2000,2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -51,7 +51,7 @@ Operators are listed below in order of increasing precedence. Operators with equal precedence are grouped within { } symbols. .Bl -tag -width indent -.It Ar expr1 Li | Ar expr2 +.It Ar expr1 Li \&| Ar expr2 Returns the evaluation of .Ar expr1 if it is neither an empty string nor zero; @@ -72,7 +72,7 @@ Returns the results of addition or subtraction of integer-valued arguments. .It Ar expr1 Li "{*, /, %}" Ar expr2 Returns the results of multiplication, integer division, or remainder of integer-valued arguments. -.It Ar expr1 Li : Ar expr2 +.It Ar expr1 Li \&: Ar expr2 The .Dq \&: operator matches @@ -100,7 +100,7 @@ .Pp Additionally, the following keywords are recognized: .Bl -tag -width indent -.It length Ar expr +.It length Ar expr Returns the length of the specified string in bytes. .El .Pp @@ -126,7 +126,7 @@ .It .Dq \*[Am] .It -.Dq \Z'\*[tty-rn]'| +.Dq \&| .El .Sh EXIT STATUS The @@ -159,38 +159,6 @@ The following example returns the number of characters in variable a. .Dl expr $a Li : '.*' .El -.Sh STANDARDS -The -.Nm -utility conforms to -.St -p1003.2 . -The -.Ar length -keyword is an extension for compatibility with GNU -.Nm . -.Sh AUTHORS -Original implementation was written by -.An J.T. Conklin -.Aq j...@netbsd.org . -It was rewritten for -.Nx 1.6 -by -.An Jaromir Dolecek -.Aq jdole...@netbsd.org . -.Sh NOTES -The empty string -.Dq -cannot be matched with the intuitive: -.Bd -literal -offset indent -expr '' : '$' -.Ed -.Pp -The reason is that the returned number of matched characters (zero) -is indistinguishable from a failed match, so this returns failure. -To match the empty string, use something like: -.Bd -literal -offset indent -expr x'' : 'x$' -.Ed .Sh COMPATIBILITY This implementation of .Nm @@ -249,3 +217,35 @@ handles both cases correctly, you should not depend on this behavior for portability reasons and avoid passing bare '--' as first argument. +.Sh STANDARDS +The +.Nm +utility conforms to +.St -p1003.2 . +The +.Ar length +keyword is an extension for compatibility with GNU +.Nm . +.Sh AUTHORS +Original implementation was written by +.An J.T. Conklin +.Aq j...@netbsd.org . +It was rewritten for +.Nx 1.6 +by +.An Jaromir Dolecek +.Aq jdole...@netbsd.org . +.Sh NOTES +The empty string +.Do Dc +cannot be matched with the intuitive: +.Bd -literal -offset indent +expr '' : '$' +.Ed +.Pp +The reason is that the returned number of matched characters (zero) +is indistinguishable from a failed match, so this returns failure. +To match the empty string, use something like: +.Bd -literal -offset indent +expr x'' : 'x$' +.Ed