[BusyBox] Re: Bug Report:BB 1.00 sed(address "$" matches end of all input files)

Rob Landley rob at landley.net
Thu Nov 4 21:50:32 UTC 2004


On Tuesday 02 November 2004 03:48, Hiroshi Ito wrote:
> Hello, Rob.
>
> I found another bug.

I'm glad somebody is.  Sorry I've been offline for a couple days...

> ---BB's sed---
> /tmp # (echo 1; echo 2; echo 3) > a
> /tmp # sed -n -e '$ p' a a
> 3		    <= $ matches end of first file.
> 3

Hmmm...  Not quite sure what the space between $ and p would do in this 
context.  I'd have to look at the code or the spec, but it's probably 
skipped...

> /tmp # sed -n -e '3,4 p' a a
> 3		    <= good.
> 1
> /tmp # sed -n -e '2,$ p' a a
> 2
> 3		   <= $ matched end of first file.
> /tmp # sed -n -e '$,4 p' a a a
> 3		   <= $ matched end of first file.
> 1
> 3		   <= $ matched end of second file.
> 3

Line count's getting reset with each new input file isn't it?  Sigh.  
Shouldn't be too hard to fix, but again it'll have to wait until this 
evening...

Rob




More information about the busybox mailing list