Manual: mention more expr pitfalls.

* doc/autoconf.texi (Limitations of Usual Tools) <expr (:)>:
Mention HP-UX limitation, and $ ambiguity.
* THANKS: Update.
Reported by Jens Schmidt, in http://bugs.debian.org/466990.

Signed-off-by: Eric Blake <ebb9@byu.net>
This commit is contained in:
Eric Blake 2009-03-17 19:33:08 -06:00
parent 8a54ca8043
commit abee382683
3 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2009-03-18 Eric Blake <ebb9@byu.net>
Manual: mention more expr pitfalls.
* doc/autoconf.texi (Limitations of Usual Tools) <expr (:)>:
Mention HP-UX limitation, and $ ambiguity.
* THANKS: Update.
Reported by Jens Schmidt, in http://bugs.debian.org/466990.
2009-03-17 Jim Meyering <meyering@redhat.com>
Manual: fix a typo.

1
THANKS
View File

@ -164,6 +164,7 @@ Jeffrey A Law law@cygnus.com
Jeffrey J. Barteet ?
Jennis Pruett ?
Jens Petersen petersen@redhat.com
Jens Schmidt jens.schmidt35@arcor.de
Jeremy Yallop jeremy@yallop.org
Jerker Bäck jerker.back@home.se
Jim Blandy jimb@wookumz.gnu.ai.mit.edu

View File

@ -16642,6 +16642,21 @@ Portable @command{expr} regular expressions should not begin with
@samp{^}. Patterns are automatically anchored so leading @samp{^} is
not needed anyway.
On the other hand, the behavior of the @samp{$} anchor is not portable
on multi-line strings. Posix is ambiguous whether the anchor applies to
each line, as was done in older versions of @acronym{GNU} Coreutils, or
whether it applies only to the end of the overall string, as in
Coreutils 6.0 and most other implementations.
@example
$ @kbd{baz='foo}
> @kbd{bar'}
$ @kbd{expr "X$baz" : 'X\(foo\)$'}
$ @kbd{expr-5.97 "X$baz" : 'X\(foo\)$'}
foo
@end example
The Posix standard is ambiguous as to whether
@samp{expr 'a' : '\(b\)'} outputs @samp{0} or the empty string.
In practice, it outputs the empty string on most platforms, but portable
@ -16718,6 +16733,14 @@ $ @kbd{expr 00001 : '.*\(...\)'}
1
@end example
On @acronym{HP-UX} 11, @command{expr} only supports a single
sub-expression.
@example
$ @kbd{expr 'Xfoo' : 'X\(f\(oo\)*\)$'}
expr: More than one '\(' was used.
@end example
@item @command{fgrep}
@c ------------------