From unknown Sat Aug 09 01:11:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42402: Enhancement request re zcat with empty files Resent-From: Peter Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gzip@gnu.org Resent-Date: Fri, 17 Jul 2020 04:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42402 X-GNU-PR-Package: gzip X-GNU-PR-Keywords: To: 42402@debbugs.gnu.org X-Debbugs-Original-To: bug-gzip@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159496056732516 (code B ref -1); Fri, 17 Jul 2020 04:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jul 2020 04:36:07 +0000 Received: from localhost ([127.0.0.1]:56429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwI6Q-0008SN-8P for submit@debbugs.gnu.org; Fri, 17 Jul 2020 00:36:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:39350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwHGO-0007Ao-3k for submit@debbugs.gnu.org; Thu, 16 Jul 2020 23:42:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwHGN-0002MO-T2 for bug-gzip@gnu.org; Thu, 16 Jul 2020 23:42:19 -0400 Received: from nsstlmta40p.bpe.bigpond.com ([203.38.21.40]:57532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwHGK-0008DH-Jj for bug-gzip@gnu.org; Thu, 16 Jul 2020 23:42:19 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep40p-svc.bpe.nexus.telstra.com.au with ESMTP id <20200717034205.QUAY30939.nsstlfep40p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com> for ; Fri, 17 Jul 2020 13:42:05 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduiedrfeehgdejhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfupfevtfgpvffgnffuvffttedpqfgfvfenuceurghilhhouhhtmecugedttdenucenucfjughrpefhuffvkffffgggtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghrucfjohhrnhcuoehpvghtvghrrdhhohhrnhessghighhpohhnugdrtghomheqnecuggftrfgrthhtvghrnhepueegueetgeekvdfhudejffektefhffeffedugeeulefhudfgffevieegjeffvddvnecukfhppeduvddurddvudekrdefrddvudeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgdujedvrdduledrvdegfedrudeikegnpdhinhgvthepuddvuddrvddukedrfedrvdduiedpmhgrihhlfhhrohhmpeeophgvthgvrhdrhhhorhhnsegsihhgphhonhgurdgtohhmqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeosghughdqghiiihhpsehgnhhurdhorhhgqe X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RG-VS-CLASS: clean X-Authentication-Info: Submitted using ID peter.horn@bigpond.com Received: from [172.19.243.168] (121.218.3.216) by smtp.telstra.com (5.8.420) (authenticated as peter.horn@bigpond.com) id 5EA73262204403CE for bug-gzip@gnu.org; Fri, 17 Jul 2020 13:42:04 +1000 From: Peter Horn Message-ID: <5478eab2-86bd-7078-e5fa-ec3d44d4454d@bigpond.com> Date: Fri, 17 Jul 2020 13:42:04 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=203.38.21.40; envelope-from=peter.horn@bigpond.com; helo=nsstlmta40p.bpe.bigpond.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/16 23:42:05 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.2 (/) X-Mailman-Approved-At: Fri, 17 Jul 2020 00:36:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hello list, This is my first post here, so apologies in advance for whatever I get wrong. I am asking for an enhancement to zcat, that it should silently ignore empty files, either always, or (if that conflicts with POSIX or some other standard), by a command line option. My use case is as follows: I maintain a server, and have occasion to scan log files for specific items. As is typical in a logrotate environment, the files are something like xyz.log              current xyz.log.1           previous xyz.log.2.gz xyz.log.3.gz      etc etc Most of the time I can search for something by zgrep 'target' xyz* But, wanting to further process a number of entries, I tried the obvious zcat xyz* | awk ... which results in gzip: xyz.log.1: unexpected end of file I note that it correctly handles archives with no content (just the 20 byte header) Regards, Peter From unknown Sat Aug 09 01:11:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42402: Enhancement request re zcat with empty files Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-gzip@gnu.org Resent-Date: Sat, 18 Jul 2020 05:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42402 X-GNU-PR-Package: gzip X-GNU-PR-Keywords: To: Peter Horn Cc: 42402@debbugs.gnu.org Received: via spool by 42402-submit@debbugs.gnu.org id=B42402.15950511306350 (code B ref 42402); Sat, 18 Jul 2020 05:46:02 +0000 Received: (at 42402) by debbugs.gnu.org; 18 Jul 2020 05:45:30 +0000 Received: from localhost ([127.0.0.1]:58223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwff8-0001eL-Ko for submit@debbugs.gnu.org; Sat, 18 Jul 2020 01:45:30 -0400 Received: from havoc.proulx.com ([96.88.95.61]:53834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwff6-0001e8-Om for 42402@debbugs.gnu.org; Sat, 18 Jul 2020 01:45:29 -0400 Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 06F49659; Fri, 17 Jul 2020 23:45:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proulx.com; s=dkim2048; t=1595051123; bh=bG2Gl/2Q7G+EDdq5O/4mLYqJQM5m7FcpSW9MBbx5Tj0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k9YZx85i+UHEoXc71LoyARDt8w+iMem8gj9j+f4WUBIB/DLCH/2faDFSVVStlnc/0 979y4eIahhuS+ZL48GKhQ03w1Xr/Q/ubDmmvHrLC2iQMrrrlH+vDFWEVHRyZ8emMI4 MUwmZldgLMd9xaWYicd/tqOfIwVk9wA27sI9b4NW7CsL8DMyObmmmBZoOLVjANYTXI jNguykHe1mgf8tPgwDhvl5zdYYwbA2QM0pNBZU9FlfroasqgxrYiGXkzuPVPpQIjbh AMO8bEcbTc2fFbfpyZdJAvqsvMwaQfCPe7MJqUQNx7ZS19WA7oW8rwM3Vwpl6ZSkx4 W5hhSJG41hthQ== Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id A7B6921151; Fri, 17 Jul 2020 23:45:22 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 8AD802DC9C; Fri, 17 Jul 2020 23:45:22 -0600 (MDT) Date: Fri, 17 Jul 2020 23:45:22 -0600 From: Bob Proulx Message-ID: <20200717234038957718630@bob.proulx.com> References: <5478eab2-86bd-7078-e5fa-ec3d44d4454d@bigpond.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5478eab2-86bd-7078-e5fa-ec3d44d4454d@bigpond.com> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Peter Horn wrote: > But, wanting to further process a number of entries, I tried the obvious > zcat xyz* | awk ... > which results in > gzip: xyz.log.1: unexpected end of file To perhaps help work around the issue you have raised I'll just suggest that 'zmore' and 'zless' can be (ab)used in this case. They are both the same. And also though you mentioned 'zgrep' it can also be used early in the pipeline. Try it this way. zmore xyz.log* | awk ... zless xyz.log* | awk ... zgrep whatever xyz.log* | awk ... It's somewhat backing into the solution but perhaps useful for you in the toolbox regardless. Bob From unknown Sat Aug 09 01:11:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Peter Horn Subject: bug#42402: closed (Re: Enhancement request re zcat with empty files) Message-ID: References: <5478eab2-86bd-7078-e5fa-ec3d44d4454d@bigpond.com> X-Gnu-PR-Message: they-closed 42402 X-Gnu-PR-Package: gzip Reply-To: 42402@debbugs.gnu.org Date: Thu, 07 Apr 2022 00:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1649290142-9003-1" This is a multi-part message in MIME format... ------------=_1649290142-9003-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #42402: Enhancement request re zcat with empty files which was filed against the gzip package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 42402@debbugs.gnu.org. --=20 42402: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D42402 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1649290142-9003-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 42402-done) by debbugs.gnu.org; 7 Apr 2022 00:08:27 +0000 Received: from localhost ([127.0.0.1]:59333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncFhL-0002K7-9x for submit@debbugs.gnu.org; Wed, 06 Apr 2022 20:08:27 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:34550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncFhJ-0002Jp-6u for 42402-done@debbugs.gnu.org; Wed, 06 Apr 2022 20:08:26 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DA99D1600C0; Wed, 6 Apr 2022 17:08:18 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hINaijGCMAhm; Wed, 6 Apr 2022 17:08:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4EF091600D4; Wed, 6 Apr 2022 17:08:18 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3eIdEsEVdriR; Wed, 6 Apr 2022 17:08:18 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2EB7B1600C0; Wed, 6 Apr 2022 17:08:18 -0700 (PDT) Message-ID: Date: Wed, 6 Apr 2022 17:08:17 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Peter Horn From: Paul Eggert Subject: Re: Enhancement request re zcat with empty files Organization: UCLA Computer Science Department Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42402-done Cc: 42402-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I am asking for an enhancement to zcat, that it should silently ignore > empty files, either always, or (if that conflicts with POSIX or some > other standard), by a command line option. zcat -f does what you're asking for. For example: $ touch empty $ echo something | gzip >abc.gz $ zcat -f * something Since the -f option satisfies your request I'll close the bug report. ------------=_1649290142-9003-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Jul 2020 04:36:07 +0000 Received: from localhost ([127.0.0.1]:56429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwI6Q-0008SN-8P for submit@debbugs.gnu.org; Fri, 17 Jul 2020 00:36:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:39350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jwHGO-0007Ao-3k for submit@debbugs.gnu.org; Thu, 16 Jul 2020 23:42:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwHGN-0002MO-T2 for bug-gzip@gnu.org; Thu, 16 Jul 2020 23:42:19 -0400 Received: from nsstlmta40p.bpe.bigpond.com ([203.38.21.40]:57532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwHGK-0008DH-Jj for bug-gzip@gnu.org; Thu, 16 Jul 2020 23:42:19 -0400 Received: from smtp.telstra.com ([10.10.24.4]) by nsstlfep40p-svc.bpe.nexus.telstra.com.au with ESMTP id <20200717034205.QUAY30939.nsstlfep40p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com> for ; Fri, 17 Jul 2020 13:42:05 +1000 X-RG-Spam: Unknown X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduiedrfeehgdejhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfupfevtfgpvffgnffuvffttedpqfgfvfenuceurghilhhouhhtmecugedttdenucenucfjughrpefhuffvkffffgggtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghrucfjohhrnhcuoehpvghtvghrrdhhohhrnhessghighhpohhnugdrtghomheqnecuggftrfgrthhtvghrnhepueegueetgeekvdfhudejffektefhffeffedugeeulefhudfgffevieegjeffvddvnecukfhppeduvddurddvudekrdefrddvudeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgdujedvrdduledrvdegfedrudeikegnpdhinhgvthepuddvuddrvddukedrfedrvdduiedpmhgrihhlfhhrohhmpeeophgvthgvrhdrhhhorhhnsegsihhgphhonhgurdgtohhmqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeosghughdqghiiihhpsehgnhhurdhorhhgqe X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RG-VS-CLASS: clean X-Authentication-Info: Submitted using ID peter.horn@bigpond.com Received: from [172.19.243.168] (121.218.3.216) by smtp.telstra.com (5.8.420) (authenticated as peter.horn@bigpond.com) id 5EA73262204403CE for bug-gzip@gnu.org; Fri, 17 Jul 2020 13:42:04 +1000 From: Peter Horn Subject: Enhancement request re zcat with empty files To: bug-gzip@gnu.org Message-ID: <5478eab2-86bd-7078-e5fa-ec3d44d4454d@bigpond.com> Date: Fri, 17 Jul 2020 13:42:04 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=203.38.21.40; envelope-from=peter.horn@bigpond.com; helo=nsstlmta40p.bpe.bigpond.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/16 23:42:05 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 17 Jul 2020 00:36:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hello list, This is my first post here, so apologies in advance for whatever I get wrong. I am asking for an enhancement to zcat, that it should silently ignore empty files, either always, or (if that conflicts with POSIX or some other standard), by a command line option. My use case is as follows: I maintain a server, and have occasion to scan log files for specific items. As is typical in a logrotate environment, the files are something like xyz.log              current xyz.log.1           previous xyz.log.2.gz xyz.log.3.gz      etc etc Most of the time I can search for something by zgrep 'target' xyz* But, wanting to further process a number of entries, I tried the obvious zcat xyz* | awk ... which results in gzip: xyz.log.1: unexpected end of file I note that it correctly handles archives with no content (just the 20 byte header) Regards, Peter ------------=_1649290142-9003-1--