emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#30550: closed (zgrep over multiple files returns 1


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#30550: closed (zgrep over multiple files returns 1 if pattern not found in a single file even if found in other files)
Date: Wed, 21 Feb 2018 19:32:02 +0000

Your message dated Wed, 21 Feb 2018 11:31:47 -0800
with message-id <address@hidden>
and subject line Re: bug#30550: zgrep over multiple files returns 1 if pattern 
not found in a single file even if found in other files
has caused the debbugs.gnu.org bug report #30550,
regarding zgrep over multiple files returns 1 if pattern not found in a single 
file even if found in other files
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
30550: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30550
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: zgrep over multiple files returns 1 if pattern not found in a single file even if found in other files Date: Tue, 20 Feb 2018 15:01:05 +0000 (UTC)
grep version: 2.20
zgrep version: 1.5

$cat test1
hello

$cat test2
goodbye

$cat test3
goodbye

$cat test4
goodbye

$grep "hello" test1     #works as expected
hello
$echo $?
0

$grep "goodbye" test1     #works as expected
$echo $?
1

$grep "hello" *    #works as expected. gets line from test1 and returns 0
test1:hello
$echo $?
0

$grep "goodbye" *    #works as expected. gets lines from test2, 3, and 4 and returns 0
test2:goodbye
test3:goodbye
test4:goodbye
$echo $?
0


despite stating zgrep works the same as grep, the return codes over multiple files are different

$zgrep "hello" test1     #works as expected
hello
$echo $?
0

$zgrep "goodbye" test1     #works as expected
$echo $?
1

$zgrep "hello" *    #does NOT work as expected. gets line from test1 and returns 1. grep states that if ANY line is found, 0 will be returned
test1:hello
$echo $?
1

$zgrep "goodbye" *    #does NOT work as expected. gets lines from test2, 3, and 4 and returns 1. grep states that if ANY line is found, 0 will be returned
test2:goodbye
test3:goodbye
test4:goodbye
$echo $?
1

$zgrep "goodbye" test2 test3 test4    #works as expected. finds pattern in all files and returns 0. bug only occurs if files exist where the pattern is not found
test2:goodbye
test3:goodbye
test4:goodbye
$echo $?
0

--- End Message ---
--- Begin Message --- Subject: Re: bug#30550: zgrep over multiple files returns 1 if pattern not found in a single file even if found in other files Date: Wed, 21 Feb 2018 11:31:47 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
On 02/20/2018 07:01 AM, David McCauley wrote:
zgrep version: 1.5

That's pretty old. The bug should be fixed in the current zgrep version (1.9). See:

https://bugs.gnu.org/17760



--- End Message ---

reply via email to

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