]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix some regressions with the zgrep(1) wrapper.
authorCraig Leres <leres@FreeBSD.org>
Mon, 20 Jul 2020 23:57:53 +0000 (23:57 +0000)
committerCraig Leres <leres@FreeBSD.org>
Mon, 20 Jul 2020 23:57:53 +0000 (23:57 +0000)
commitc4cbf1fbabcb84d9d0a49c2444ed398ed9907df5
tree7afae2ba39cbe80b9f1fc1ac681bf71831d1e16f
parent66ba9aafcf88fe900016254e6063969f15d59c7b
Fix some regressions with the zgrep(1) wrapper.

 - Handle whitespace with long flags that take arguments:

echo 'foo bar' > test
zgrep --regexp='foo bar' test

 - Do not hang reading from stdin with patterns in a file:

echo foobar > test
echo foo > pattern
zgrep -f pattern test
zgrep --file=pattern test

 - Handle any flags after -e:

echo foobar > test
zgrep -e foo --ignore-case < test

These two are still outstanding problems:

 - Does not handle flags that take an argument if there is no
   whitespace:

zgrep -enfs /etc/rpc

 - When more than one -e pattern used matching should occur for all
   patterns (similar to multiple patterns supplied with -f file).
   Instead only the last pattern is used for matching:

zgrep -e rex -e nfs /etc/rpc

   (This problem is masked in the unpatched version by the "any
   flags after -e" problem.)

Add tests for the above problems.

Update the mange and add references to gzip(1) and zstd(1) and also
document the remaining known problems.

PR: 247126
Approved by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25613
contrib/netbsd-tests/usr.bin/grep/t_grep.sh
usr.bin/grep/zgrep.1
usr.bin/grep/zgrep.sh