bug#1064: [BusyBox] bug#1064: grep -v "^$" fails under mysterious circumstances

Mark Whitley markw at lineo.com
Thu Oct 12 23:20:35 UTC 2000


On Thu, Oct 12, 2000 at 01:44:02PM -0500, David Douthitt wrote:
> I'm using
> 
> grep -v "^$"
> 
> with one to four line files, and in one particular case it failed 
> repeatedly (on a one line file).

David,

I cannot duplicate this bug with the latest from CVS. Some tests follow:

---cut here------
[markw at shiva busybox]$ cat oneline.txt 
This file has one line
[markw at shiva busybox]$ cat oneline.txt | ./busybox grep '^$'
This file has one line
[markw at shiva busybox]$ cat twolines.txt 
This file has
two lines
[markw at shiva busybox]$ cat twolines.txt | ./busybox grep '^$'
This file has
two lines
[markw at shiva busybox]$ cat threelines.txt 
This file has
only
three lines
[markw at shiva busybox]$ cat threelines.txt | ./busybox grep '^$'
This file has
only
three lines
[markw at shiva busybox]$ cat fourlines.txt 
This file
has
only
four lines
[markw at shiva busybox]$ cat fourlines.txt | ./busybox grep '^$'
This file
has
only
four lines
[markw at shiva busybox]$ 
---cut here------

I checked to see if it was a problem with the way the shell escapes quotes so
I tried the following:

---cut here------
[markw at shiva busybox]$ cat oneline.txt | ./busybox grep ^$
This file has one line
[markw at shiva busybox]$ cat oneline.txt | ./busybox grep '^$'
This file has one line
[markw at shiva busybox]$ cat oneline.txt | ./busybox grep "^$"
This file has one line
---cut here------

They all worked.

Last, I tried doing the same tests inside busybox shell and got the following:

---cut here------
/home/markw/devel/busybox # cat oneline.txt | grep ^$          
This file has one line
cat: oneline.txt: No such file or directory
/home/markw/devel/busybox # cat oneline.txt | grep '^$'
This file has one line
cat: oneline.txt: No such file or directory
/home/markw/devel/busybox # cat oneline.txt | grep "^$"
This file has one line
cat: oneline.txt: No such file or directory
---cut here------

It did consistently produce an error, but one different from the one you
found, and unrelated, I think.

So I'm sorry, but I can't dup the problem. Can you check out the latest from
CVS and see if you can dup it. If so, please send the file that you are
catting / grepping that produces the error.

Thanks,

Mark Whitley
markw at lineo.com






More information about the busybox mailing list