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 
<egg...@cs.ucla.edu> 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?



  

Reply via email to