zutils-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Zutils-bug] zgrep 1.6 with -q option exits with wrong code when usi


From: Antonio Diaz Diaz
Subject: Re: [Zutils-bug] zgrep 1.6 with -q option exits with wrong code when using wildcards
Date: Mon, 16 Oct 2017 12:31:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

Hi Michele,

Michele Giacomoli wrote:
Just found that zgrep in Ubuntu 16.04 (version 1.6-4ubuntu1) exits with
wrong code when using -q option and searching in multiple files using
"*" wildcard.

More in detail: if at least one of the files matched by the wildcard
doesn't contain the text you are looking for, the exit code is 1, while
it should be 0. If all the files matched by the wildcard contain the
text, then it correctly exits with code 0.

I can't reproduce the problem using the latest zgrep 1.7-pre1:

$ echo 'foo bar' > foobar
$ echo 'foo baz' > foobaz
$ zgrep -q foo * ; echo $?
0
$ zgrep -q bar * ; echo $?
0
$ zgrep -q baz * ; echo $?
0
$ lzip -v *
  foobar:  0.182:1, 550.00% ratio, -450.00% saved, 8 in, 44 out.
  foobaz:  0.182:1, 550.00% ratio, -450.00% saved, 8 in, 44 out.
$ zgrep -q foo * ; echo $?
0
$ zgrep -q bar * ; echo $?
0
$ zgrep -q baz * ; echo $?
0

What is the exact configuration that failed? (Command line used, versions of grep and decompressors, compressed formats, file permissions, etc).


Best regards,
Antonio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]