bug#21414: -F string with tailing newline always matches

2015-09-04 Thread Ian Brown - HNAS
Grep version 2.20 When using the ouput of another command to pass match strings into grep using -F I was getting unexpected results as it was matching every line. If the terminating newline is removed the grep started to work again. Easy to work around but this is different behaviour from 2.12

bug#21414: -F string with tailing newline always matches

2015-09-04 Thread Paul Eggert
On 09/04/2015 07:45 AM, Ian Brown - HNAS wrote: Grep version 2.20 When using the ouput of another command to pass match strings into grep using -F I was getting unexpected results as it was matching every line. If the terminating newline is removed the grep started to work again. Easy to work

bug#21414: -F string with tailing newline always matches

2015-09-04 Thread Jim Meyering
On Fri, Sep 4, 2015 at 10:34 AM, Paul Eggert wrote: > On 09/04/2015 07:45 AM, Ian Brown - HNAS wrote: >> >> Grep version 2.20 >> >> When using the ouput of another command to pass match strings into grep >> using -F I was getting unexpected results as it was matching every line. If >> the terminat

bug#21414: -F string with tailing newline always matches

2015-09-04 Thread Paul Eggert
Jim Meyering wrote: I too find this behavior surprising: $ seq 3|grep -F xxx$'\n' 1 2 3 This feels like a bug, since it's an artifact of how grep accumulates multiple keys internally: it uses newline as the separator (http://git.savannah.gnu.org/cgit/grep.git/tree/src/grep.c#n2308). Including a

bug#21414: -F string with tailing newline always matches

2015-09-04 Thread Jim Meyering
On Fri, Sep 4, 2015 at 8:45 PM, Paul Eggert wrote: > Jim Meyering wrote: >> >> I too find this behavior surprising: >> >> $ seq 3|grep -F xxx$'\n' >> 1 >> 2 >> 3 >> >> This feels like a bug, since it's an artifact of how grep accumulates >> multiple keys internally: it uses newline as the separato