Subject: bug#70511: Option to grep into compressed files

From: "David G. Pickett" <[email-masked]>
Date: Mon, 22 Apr 2024 14:00:32 +0000 (UTC)

One supposes that if the file extension is not trustworthy, one can taste file like the file command, and use libraries like the gzip libraries to handle gzipped files as a stream.  There are so many others: zip files could be treated like directories and all the files in them that match the glob could be searched, and then there is bzip2, 7zip, ....  It becomes a popularity contest!  One can do all this with shell scripting, and leave poor old grep out of it!
    On Monday, April 22, 2024 at 03:48:14 AM EDT, Paul Eggert <[email-masked]> wrote:  
 
 Thanks for the suggestion. You're right, this would be better than zgrep 
etc.

I have some qualms though, as the new option would increase the attack 
surface for 'grep', in that you could then execute arbitrary code by 
passing certain options to 'grep'. Is there some safer way to get what 
you want?