AW: sed bug ?

dietmar.schindler at manroland-web.com dietmar.schindler at manroland-web.com
Thu Nov 17 13:01:38 UTC 2016


> Von: Timo Teräs
> Gesendet: Donnerstag, 17. November 2016 13:23
>
> On Thu, 17 Nov 2016 12:08:27 +0000
> <dietmar.schindler at manroland-web.com> wrote:
>
> > > Von: Timo Teras
> > > Gesendet: Donnerstag, 17. November 2016 10:56
> > >
> > > The following discrepancy happens on 1.25.1 (and git master) with
> > > musl c-library:
> > >
> > > ~ $ echo /usr/lib/ | sed 's,\(^/\|\)[^/][^/]*,..,g'
> > > ../../
> > >
> > > ~ $ echo /usr/lib/ | busybox sed 's,\(^/\|\)[^/][^/]*,..,g'
> > > /../../
> > >
> > > Any thoughts?
> >
> > The output of busybox sed is indeed incorrect.
>
> Someone replied offlist that the regexp is using \| which apparently is
> GNU extension. Apparently it would be better to convert the above to
> use ERE, or fix it in some other manner.

While POSIX sed is only required to support Basic Regular Expressions, BusyBox sed knows \| - otherwise the above expression would yield no substitution at all; older BusyBox versions (e. g. v1.20.2) did handle it correctly.
--
Regards,
Dietmar
________________________________
manroland web systems GmbH -- Managing Director: Alexander Wassermann
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No.: 26816 -- VAT: DE281389840

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, then please delete this eMail.
________________________________


More information about the busybox mailing list