[BusyBox] separating multiple sed commands

Rob Landley rob at landley.net
Sun Jan 4 01:52:02 UTC 2004


On Saturday 03 January 2004 07:00, Frank Lenaerts wrote:
> On Sat, Jan 03, 2004 at 06:21:09AM -0600, Rob Landley wrote:
> > On Friday 02 January 2004 14:07, Frank Lenaerts wrote:
> > > While migrating from a 0.60.x (busybox 0.60.5 in Debian Sid) to a
> > > 1.0.0-preX (busybox-cvs version from 20031212 in Debian Sid,
> > > corresponding to 1.0.0-pre4) busybox, I noticed a difference in the
> > > sed's behaviour.
> > >
> > > In the older version, I could use a semicolon to separate sed
> > > commands e.g.:
> > >
> > > sed 's/.*key=\(.*\)/\1/ ; s/ .*//' some_file ;
> > >
> > > In the newer version, this does not work anymore and I get a "sed: bad
> > > option in substitution" error. When I rewrite the sed commands without
> > > a semicolon however, everything works fine e.g.:
> > >
> > > sed '
> > > s/.*key=\(.*\)/\1/
> > > s/ .*//
> > > ' some_file ;
> > >
> > > This can thus be used as a work-around, but I don't know if the fact
> > > that using a semicolon to separate sed commands results in an error is
> > > the purpose (i.e. a builtin limitation) or not (i.e. a bug).
> >
> > I rewrote the sed code fairly extensively, and if the GNU or BSD version
> > can
>
> It works with GNU sed and with Busybox's 0.60.5 sed.

Depends on your definition of "works", of course.  If the key you're searching 
for isn't in the list, you get the first key=value pair out as a result...

But I see what it's doing now.

I got your testcase, and am looking into it...

Rob




More information about the busybox mailing list