From 9c16f1a80d38800d400403a78f322b74c09c827d Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Thu, 10 Sep 2009 06:56:45 +0200 Subject: [PATCH] Document sed limitation with escaped metacharacters. * doc/autoconf.texi (Limitations of Usual Tools) : Use `%' rather than `/' as delimiter in an example `s' command. Document inconsistent treatment of escaped metacharacters. * THANKS: Update. Report by Dave Korn, with additional input from Paolo Bonzini and Eric Blake. Signed-off-by: Ralf Wildenhues --- ChangeLog | 8 ++++++++ THANKS | 1 + doc/autoconf.texi | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9079a0ea9..80f560994 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2009-09-10 Ralf Wildenhues + Document sed limitation with escaped metacharacters. + * doc/autoconf.texi (Limitations of Usual Tools) : Use `%' + rather than `/' as delimiter in an example `s' command. + Document inconsistent treatment of escaped metacharacters. + * THANKS: Update. + Report by Dave Korn, with additional input from Paolo Bonzini + and Eric Blake. + Document temporary directory `$tmp' for use in config.status. * doc/autoconf.texi (Configuration Actions): Document `$tmp'. * NEWS: Update. diff --git a/THANKS b/THANKS index 460e68052..0901d6ac7 100644 --- a/THANKS +++ b/THANKS @@ -86,6 +86,7 @@ Daniel Reed ? Daniele Arena daniele@ripe.net Dave Adams adams@hpesdwa.fc.hp.com Dave Erickson retrorandomaccess@hotmail.com +Dave Korn dave.korn.cygwin@googlemail.com Dave Love fx@gnu.org David Byron dbyron@hheld.com David Carter david@carter.net diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 320ef238e..82a9f2aa3 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -17511,7 +17511,11 @@ directory. @prindex @command{sed} Patterns should not include the separator (unless escaped), even as part of a character class. In conformance with Posix, the Cray -@command{sed} rejects @samp{s/[^/]*$//}: use @samp{s,[^/]*$,,}. +@command{sed} rejects @samp{s/[^/]*$//}: use @samp{s%[^/]*$%%}. +Even when escaped, patterns should not include separators that are also +used as @command{sed} metacharacters. For example, GNU sed 4.0.9 rejects +@samp{s,x\@{1\,\@},,}, while sed 4.1 strips the backslash before the comma +before evaluating the basic regular expression. Avoid empty patterns within parentheses (i.e., @samp{\(\)}). Posix does not require support for empty patterns, and Unicos 9 @command{sed} rejects -- 2.47.3