Received: (at submit) by debbugs.gnu.org; 22 Apr 2024 06:51:36 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 02:51:36 2024 Received: from localhost ([127.0.0.1]:45560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rynWY-0005NP-In for submit <at> debbugs.gnu.org; Mon, 22 Apr 2024 02:51:36 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <marycada@HIDDEN>) id 1ryaLE-0002sw-CN for submit <at> debbugs.gnu.org; Sun, 21 Apr 2024 12:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <marycada@HIDDEN>) id 1ryaKq-0003aX-Cv for bug-grep@HIDDEN; Sun, 21 Apr 2024 12:46:39 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <marycada@HIDDEN>) id 1ryaKn-00027Q-0e for bug-grep@HIDDEN; Sun, 21 Apr 2024 12:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1713717983; x=1713977183; bh=A4Y06umtfCkbiBumMXn/9/bmxuBLYBTSAaTR+7GuXUU=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=M1mpjO5Uz4U9xdS2CTvyutAMbdPJyXO8+sfwLKusuU5DGhxQTZdt4jfqmK1/40qB9 MnF5lha17t7jIC5vY02cQmalYiQk46kW34y3PYPDdBFirvtzZPKDofovD7Np6F1Xc7 HlmXmKjL0Xr9zqzc+nwh3OsDnHj7Y499S4CDNNUsSHmulQXjDCO5VxxQxaZvRX2gwW T2KcvQQ9ToZqJ+ZyYr9zZrId1iZ7nUMcs3F8F0r6jBV7Wq209PFQ6VfheZmxeb3rHo a07gDOGJvuJXEPHdRVS1i/9rHFqKFv6a8zAsR+KlQ4MF+DSXzGKEili39zjGzNaqnw hPH8JYKzZxRVg== Date: Sun, 21 Apr 2024 16:46:17 +0000 To: "bug-grep@HIDDEN" <bug-grep@HIDDEN> From: Mary <marycada@HIDDEN> Subject: Option to grep into compressed files Message-ID: <r8SYPW_jmJx5lUf2LRi_AFJCryoNof-uGNCSFblICfw3ZC7MG3ILJRAWYqwQR5jiBtQ3Bp6fh0SvEBgzhJI8YyY0gVqxPb4WF7stxC7L3qM=@proton.me> Feedback-ID: 107467773:user:proton X-Pm-Message-ID: 6f9ee145bc8d83ce2913fea35fb99e864c33b858 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.132; envelope-from=marycada@HIDDEN; helo=mail-40132.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 22 Apr 2024 02:51:31 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hello, I added an option to grep that filters files through a specified program. T= he main purpose for that is to uncompress files using the zcat (or `gzip -d= `) command, or an equivalent for another compression format. It works like this: grep -j zcat pattern textfile.gz [textfile2.gz...] (I chose `-j` for no particular reason. Any unused letter could go there.) This will spawn a shell and execute the given command (zcat), which will re= ceive each file through stdin and its stdout will be used in lieu of the fi= le. Any valid shell command can be used instead of zcat. This is better than the zgrep commands provided by the gzip, bzip2 and xz p= rojects, because it supports all of the options, including `-r`. It can also be used with arbitrary commands, like less popular compression = algorithms or even commands unrelated to compression. I read at https://www= .gnu.org/software/grep/devel.html that there were plans to add `-Z` and `-J= ` options for gzip and bzip2; my implementation can support any algorithm. The problem I see with that though is that it would add a shell command opt= ion to grep. This is longer to type our than `-Z` or `-J`, but it also prov= ides a shell access to anybody who can control what options grep receives. = In practice, I'm not sure how serious that is, but I thought it would be us= eful to point it out. I have a patch that I can send. I believe my patch is trivial, the only par= t that's longer than 3 lines is a simple fork-exec pattern (40 lines includ= ing whitespace, but they're the same you've seen in plenty of other program= s). I know there are specific requirements regarding copyright, and I don't= want to cause problems about that (I can't sign the FSF's documents). May = I send my patch? -- Mary PS- This is my first time using a mailing list, please let me know if I'm d= oing something wrong!
Mary <marycada@HIDDEN>
:bug-grep@HIDDEN
.
Full text available.bug-grep@HIDDEN
:bug#70511
; Package grep
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.