Leah Neukirchen
2017-08-22 16:32:51 UTC
Hi,
it seems busybox sed (v1.27.2) does not support empty regular
% 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
thx,
it seems busybox sed (v1.27.2) does not support empty regular
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: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.
% 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
thx,
--
Leah Neukirchen <***@vuxu.org> http://leah.zone
Leah Neukirchen <***@vuxu.org> http://leah.zone