Subject: bin/25345: zgrep does not work as expected (command line parsing fails?)
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <arto@selonen.org>
List: netbsd-bugs
Date: 04/27/2004 09:01:49
>Number: 25345
>Category: bin
>Synopsis: zgrep does not work as expected (command line parsing fails?)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Apr 27 09:02:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Arto Selonen
>Release: NetBSD-current from ~20040422
>Organization:
>Environment:
NetBSD blah 2.0C NetBSD 2.0C (BLAH) #33: Sat Apr 24 12:29:17 EEST 2004 blah@blah:/obj/sys/arch/i386/compile/BLAH i386
>Description:
zgrep "pattern1 pattern2" file.gz assumes that pattern2 is also a file name; fails to produce correct results
>How-To-Repeat:
% cat > zgrep-problem-demo
aa ab ac
ba bb bc
ca cb cc
db dc dd
<EOF>
% gzip zgrep-problem-demo
% zgrep "a b" zgrep-problem-demo.gz
grep: b: No such file or directory
zgrep-problem-demo.gz:aa ab ac
zgrep-problem-demo.gz:ba bb bc
zgrep-problem-demo.gz:ca cb cc
compare that with the correct result:
% zcat zgrep-problem-demo.gz | grep "a b"
ba bb bc
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: