[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: sed: missing support for empty regular expressions
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2017-08-23 15:57:20
Message-ID: CAK1hOcNrBSUOVFw2e8ctXo3nOn1Y9HK0-ibEd80OvVvsq7O-RA () mail ! gmail ! com
[Download RAW message or body]

On Tue, Aug 22, 2017 at 6:32 PM, Leah Neukirchen <leah@vuxu.org> wrote:
> Hi,
>
> it seems busybox sed (v1.27.2) does not support empty regular
> expressions as by POSIX, but instead matches the empty string:
>
>>> If an RE is empty (that is, no pattern is specified) sed shall
>>> behave as if the last RE used in the last command applied (either
>>> as an address or as part of a substitute command) was specified.
>
> GNU, OpenBSD, p9p:
> % printf '%s\n' foo bar stop quux qux | sed -n '/stop/!p;//q'
> foo
> % yes | sed //q
> GNU: sed: -e expression #1, char 0: no previous regular expression
> OpenBSD: sed: first RE may not be empty
> p9p: sed: First RE may not be null
>
> Busybox:
> % printf '%s\n' foo bar stop quux qux | busybox sed -n '/stop/!p;//q'
> foo
> % yes | busybox sed //q
> y

Fixed in git, thanks.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic