Is sed delete command broke?

Mike Frysinger vapier at gentoo.org
Tue Jan 3 19:48:35 UTC 2006


On Tuesday 03 January 2006 14:05, Chey wrote:
> This should but it doesn't. Note the delimiter here as opposed to the
> delimiter used above.

you're doing it wrong ... before you think busybox's sed is broken, why dont 
you try your examples in GNU sed first

> # sed ",^root.*,d" /etc/passwd
> sed: get_address: no address found in string

this doesnt even work in GNU sed

> Yet it works for substitute using a delimiter other than /
>
> # sed "s,^root.*,," /etc/passwd

this is not the samething as before ... the s command allows you to use any 
old delim you want; doing a regex match (as you were trying in the previous 
two examples) requires you to use //

> But I can't use sed to delete certain lines unless i 1) can get sed to
> work with different delimiters

as pointed out above, your thought process here is flawed as only the s 
command allows you to change delimeters (well and maybe the y command too)

> or 2) figure out a way to escape the / 
> in a string using only busybox commands and the ash shell.

works fine for me:
sed -n '/\/mail/p' /etc/passwd
-mike



More information about the busybox mailing list