sed behaving strangely when -n and the delete command are combined

Denys Vlasenko vda.linux at googlemail.com
Wed Jul 15 00:38:46 UTC 2009


On Tuesday 14 July 2009 06:50, Rob Landley wrote:
> > > $echo -e "first\nsecond\nthird\nfourth" | ./busybox sed -n '1d;1,3p'
> > > sed: unmatched 'e'
> > > bash: echo: write error: Broken pipe
> >
> > That's actually a feature. If you have *only one* applet,
> > multiplexer is disabled. :) It does not matter how you rename
> > the binary, it will work as that applet.
> 
> Ah.  Is this documented somewhere that I missed?

No, it's not documented.

It just makes sense. If you have just one applet, the reason why
multiplexer was needed in not valid anymore.
Why we should bloat the binary with useless multiplexer?

IIUC there are people who build a lot of busybox binaries,
one applet per binary. Allegedly their architecture does not support
code sharing and demand paging, so they would rather not have
one big binary - it takes too much RAM.

> I don't suppose there's a way to get the makefile to rename the "busybox" 
> binary to "sed" in that case?

It can be done, I guess.
--
vda


More information about the busybox mailing list