bug#23227: Inconsistent behavior for --file=~/some-file

2016-04-05 Thread Santiago Ruano Rincón
Hi, grep fails to parse the tilde (~) to represent $HOME, when it is used to give a file's path to --file=, but it works with --file % echo "a" > ~/tmp-pattern % echo "hola" | LANG=C grep --file=/home/santiago/tmp-pattern hola % echo "hola" | LANG=C grep --file /home/santiago/tmp-pattern hola % e

bug#23227: Inconsistent behavior for --file=~/some-file

2016-04-05 Thread Eric Blake
tag 23227 notabug thanks On 04/05/2016 03:55 PM, Santiago Ruano Rincón wrote: > Hi, > > grep fails to parse the tilde (~) to represent $HOME, when it is used to > give a file's path to --file=, but it works with --file That's not grep's fault, but the shell's. > % echo "hola" | LANG=C grep --f

bug#23227: Inconsistent behavior for --file=~/some-file

2016-04-05 Thread Eric Blake
On 04/05/2016 04:03 PM, Eric Blake wrote: > Tilde expansion in the shell is defined by POSIX to only happen if ~ > occurs as the first character of a word > > Since this behavior is baked into your shell, there's nothing grep can > do about it, so I'm closing this as not a bug. And before you ar

bug#23185: GNU grep matching discrepancy between -a/--text and not.

2016-04-05 Thread Paul Eggert
Thanks for pointing out the seeming inconsistency. The documentation mentions the issue but is perhaps not clear enough, so I installed the attached patch. The input file contains NUL bytes and so is treated as binary data, and the grep documentation (secton "File and Directory Selection", opti