[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep-2.6.2 -Ff hangs on files with empty lines
From: |
Jim Meyering |
Subject: |
Re: grep-2.6.2 -Ff hangs on files with empty lines |
Date: |
Sat, 03 Apr 2010 07:43:40 +0200 |
Allan McRae wrote:
...
> $ grep -Ff <(printf 'a') <(printf 'a\nb')
> a
>
> $ LC_ALL=C grep -Ff <(printf 'a') <(printf 'a\nb')
> a
>
> $ grep -Ff <(printf '\na') <(printf 'a\nb')
> a
> b
>
> $ LC_ALL=C grep -Ff <(printf '\na') <(printf 'a\nb')
> a
> b
>
> Are those last two correct?
Looks fine to me.
I suspect you intended to put just "a" *followed by* "\n"
in the file of patterns to search for.
Try it again, but with --color,
and you see that only the "a" is red (marked with [...] below).
The "b" line is matched solely because you have an empty
line in the pattern file.
$ LC_ALL=C grep --color -Ff <(printf '\na') <(printf 'a\nb')
[a]
b
Use "a\n", and you get what you expect:
$ LC_ALL=C grep -Ff <(printf 'a\n') <(printf 'a\nb')
a