Debian Bug report logs - #652838
unzip: zipgrep parses long egrep options as short options

version graph

Package: unzip; Maintainer for unzip is Santiago Vila <[email protected]>; Source for unzip is src:unzip (PTS, buildd, popcon).

Reported by: Axel Beckert <[email protected]>

Date: Tue, 20 Dec 2011 21:06:02 UTC

Severity: normal

Tags: upstream

Found in version unzip/6.0-4

Forwarded to http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], Santiago Vila <[email protected]>:
Bug#652838; Package unzip. (Tue, 20 Dec 2011 21:06:06 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], Santiago Vila <[email protected]>. (Tue, 20 Dec 2011 21:06:07 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Axel Beckert <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: unzip: zipgrep parses long egrep options as short options
Date: Tue, 20 Dec 2011 22:04:11 +0100
Package: unzip
Version: 6.0-4
Severity: normal
File: /usr/bin/zipgrep

From the zipgrep man page:

       zipgrep [egrep_options] pattern file[.zip] [file(s) ...]  [-x xfile(s) ...]

       [...]

       zipgrep is a shell script and requires egrep(1) and unzip(1) to
       function.  Its output is identical to that of egrep(1).

But the following shell code from zipgrep mistreats long options like
--color or --line-buffered (both have no equivalent short option) as
short options (or similar):

opt=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$opt" in
  *l*) list=1; opt=`echo $opt | sed s/l//`
esac
case "$opt" in
  *h*) silent=1
esac
if test -n "$opt"; then
  opt="-$opt"
fi

Examples:

$ zipgrep Axel blafasel.zip
scratch/debian/mp4h/CREDITS:      Axel Beckert ................ <[email protected]>
scratch/debian/mp4h/debian/control:Uploaders: Axel Beckert <[email protected]>
[...]
$ zipgrep --color Axel blafasel.zip
scratch/debian/mp4h/CREDITS
scratch/debian/mp4h/debian/control
[...]
$ zipgrep --color=always Axel blafasel.zip
egrep: invalid option -- '='
Usage: egrep [OPTION]... PATTERN [FILE]...
Try `egrep --help' for more information.

In the second example, the "l" in "--color" is passed as "-l" to egrep,
hence it suppresses the matches itself (and hence -o and -c are of no
effect).

In the third example "=" is passed as "-=" or so which causes egrep to
bail out due to an unknown option.

-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages unzip depends on:
ii  libbz2-1.0                    1.0.5-6    high-quality block-sorting file co
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib

unzip recommends no packages.

Versions of packages unzip suggests:
ii  zip                           3.0-3      Archiver for .zip files

-- no debconf information




Added tag(s) upstream. Request was from Santiago Vila <[email protected]> to [email protected]. (Sun, 04 Mar 2012 15:45:19 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285'. Request was from Santiago Vila <[email protected]> to [email protected]. (Sun, 04 Mar 2012 15:45:24 GMT) (full text, mbox, link).


Information forwarded to [email protected], Santiago Vila <[email protected]>:
Bug#652838; Package unzip. (Sun, 04 Mar 2012 15:51:06 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <[email protected]>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <[email protected]>. (Sun, 04 Mar 2012 15:51:06 GMT) (full text, mbox, link).


Message #14 received at [email protected] (full text, mbox, reply):

From: Santiago Vila <[email protected]>
To: Axel Beckert <[email protected]>, [email protected]
Subject: Re: Bug#652838: unzip: zipgrep parses long egrep options as short options
Date: Sun, 4 Mar 2012 16:42:47 +0100 (CET)
Thanks for the report. I've just forwarded it upstream:

http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285




Information forwarded to [email protected], Santiago Vila <[email protected]>:
Bug#652838; Package unzip. (Sun, 04 Mar 2012 16:15:05 GMT) (full text, mbox, link).


Acknowledgement sent to Santiago Vila <[email protected]>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <[email protected]>. (Sun, 04 Mar 2012 16:15:05 GMT) (full text, mbox, link).


Message #19 received at [email protected] (full text, mbox, reply):

From: Santiago Vila <[email protected]>
To: Axel Beckert <[email protected]>, [email protected]
Subject: Re: Bug#652838: unzip: zipgrep parses long egrep options as short options
Date: Sun, 4 Mar 2012 17:12:29 +0100 (CET)
Sorry, this is the right URL:

http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384




Changed Bug forwarded-to-address to 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384' from 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285' Request was from Santiago Vila <[email protected]> to [email protected]. (Sun, 04 Mar 2012 16:15:13 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 13:37:55 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.