[BusyBox] BusyBox SED bugs reproducible at will.

Matt Kraai kraai at alumni.cmu.edu
Mon Mar 18 15:18:03 UTC 2002


On Mon, Mar 18, 2002 at 08:37:42PM +0000, Benjamin Smith wrote:
> On Mon, Mar 18, 2002 at 02:41:02PM -0500, Serge Caron wrote:
> >   echo "12345" | sed -e "s/[[:space:]]*/,/g"
> >   (Infinite loop :()
> 
> Output from GNU: ,1,2,3,4,5

On my system (Debian GNU sed 3.02-8) it produces the following:

 ,1,2,3,4,5,

> > 3) BusyBox sed adds a newline at the end of the input stream
> > 
> >      echo -n "12345" | sed -e "s/3/c/" >> junk
> >      echo -n "12345" | sed -e "s/3/c/" >> junk
> >      cat junk
> >    12c45
> >    12c45
> 
> GNU sed does not add a newline.

According to SUSv2,

 Whenever the pattern space is written to standard output or a
 named file, sed will immediately follow it with a newline
 character.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020318/3f27cf15/attachment.pgp 


More information about the busybox mailing list