-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 3/22/2008 12:20 PM: |>> $ busybox sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.* \[\(.*\)\])/{s//\1/;s/,/ /gp |>> }' configure.ac |>> sed: No previous regexp. |>> [Exit 1] | | This appears to be a busybox "limitation". | I expect to work around it with this patch: | | portability: work around a "busybox sed" limitation | * configure.ac: While every other sed tested supports usage like | '/\(re\)/{s//\1/;...<NEWLINE>}', and POSIX appears to requires this, | busybox's sed does not support it. So duplicate the regexp: | '/\(re\)/{s/\(re\)/\1/;...<NEWLINE>}'. Reported by Vincent Lefevre: | <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>.
Thanks for this portability analysis. I agree that it is a violation of POSIX; perhaps someone should report this to the busybox maintainers. Meanwhile, I'm documenting it for future reference: - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkfpw3EACgkQ84KuGfSFAYC6OQCeOw1cPdjBE2ZwH++iVkpXn48j 0icAn0SljIY336+ZkVroD9J4EY7QJHu5 =ZYIO -----END PGP SIGNATURE-----
>From 5c55fb1f4db4ce31263d71744014eddde28071fd Mon Sep 17 00:00:00 2001 From: Eric Blake <[EMAIL PROTECTED]> Date: Tue, 25 Mar 2008 21:19:58 -0600 Subject: [PATCH] Document busybox sed bug. * doc/autoconf.texi (Limitations of Usual Tools): Mention restrictions when using back-references. Reported by Vincent Lefevre: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- ChangeLog | 6 ++++++ doc/autoconf.texi | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0aab398..7f82ee2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-03-26 Eric Blake <[EMAIL PROTECTED]> + Document busybox sed bug. + * doc/autoconf.texi (Limitations of Usual Tools): Mention + restrictions when using back-references. + Reported by Vincent Lefevre: + <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>. + Document Automake interaction with AC_CONFIG_MACRO_DIR. * doc/autoconf.texi (Input): Mention ACLOCAL_AMFLAGS for automake users. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 17b9045..b72d875 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -15389,6 +15389,20 @@ flushleft indented @end example +Posix requires that with an empty regular expression, the last non-empty +regular expression from either an address specification or substitution +command is applied. However, busybox 1.6.1 complains when using a +substitution command with a replacement containing a back-reference to +an empty regular expression; the workaround is repeating the regular +expression. + [EMAIL PROTECTED] [EMAIL PROTECTED] {echo abc | busybox sed '/a\(b\)c/ s//\1/'} +sed: No previous regexp. [EMAIL PROTECTED] {echo abc | busybox sed '/a\(b\)c/ s/a\(b\)c/\1/'} +b [EMAIL PROTECTED] example + @item @command{sed} (@samp{t}) @c --------------------------- -- 1.5.4
_______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils