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