From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 14 09:05:46 2012 Received: (at submit) by debbugs.gnu.org; 14 Dec 2012 14:05:46 +0000 Received: from localhost ([127.0.0.1]:42109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjVtZ-0002Mz-Hd for submit@debbugs.gnu.org; Fri, 14 Dec 2012 09:05:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42143) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjVtX-0002Ms-7v for submit@debbugs.gnu.org; Fri, 14 Dec 2012 09:05:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjVsX-000506-JP for submit@debbugs.gnu.org; Fri, 14 Dec 2012 09:04:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:33004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVsX-000502-Ga for submit@debbugs.gnu.org; Fri, 14 Dec 2012 09:04:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVsT-00085s-2I for bug-coreutils@gnu.org; Fri, 14 Dec 2012 09:04:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjVsO-0004yc-OY for bug-coreutils@gnu.org; Fri, 14 Dec 2012 09:04:36 -0500 Received: from mout.gmx.net ([212.227.15.18]:60724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjVsO-0004yS-E7 for bug-coreutils@gnu.org; Fri, 14 Dec 2012 09:04:32 -0500 Received: from mailout-de.gmx.net ([10.1.76.27]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0M0ei8-1SrHrE3QAI-00uthM for ; Fri, 14 Dec 2012 15:04:30 +0100 Received: (qmail invoked by alias); 14 Dec 2012 14:04:30 -0000 Received: from p5098db61.dip0.t-ipconnect.de (EHLO zappa.ga.local) [80.152.219.97] by mail.gmx.net (mp027) with SMTP; 14 Dec 2012 15:04:30 +0100 X-Authenticated: #11967524 X-Provags-ID: V01U2FsdGVkX1+PYO88JT2PYDOfAKPNhVViSurPzULVyUTpwoSZ02 z4MLKl4mLPaL2U From: Ruediger Meier To: bug-coreutils@gnu.org Subject: tail -f ignores SIGPIPE Date: Fri, 14 Dec 2012 15:04:28 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201212141504.29143.sweet_f_a@gmx.de> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi, I want to use tail and grep to follow a file until a particular pattern appears. But tail does not exit when grep is finished. $ echo xxx > /tmp/blabla $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx" xxx Now tail still tries to read and exits only if I write again into /tmp/blabla. Is this how it's supposed to be? cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 14 09:34:36 2012 Received: (at 13183) by debbugs.gnu.org; 14 Dec 2012 14:34:36 +0000 Received: from localhost ([127.0.0.1]:42122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjWLT-0002zm-Pg for submit@debbugs.gnu.org; Fri, 14 Dec 2012 09:34:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18227) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjWLQ-0002zZ-CG; Fri, 14 Dec 2012 09:34:33 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBEEXW4U002078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Dec 2012 09:33:33 -0500 Received: from [10.36.116.69] (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBEEXUkU013103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 09:33:31 -0500 Message-ID: <50CB38B9.1020003@draigBrady.com> Date: Fri, 14 Dec 2012 14:33:29 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Ruediger Meier Subject: Re: bug#13183: tail -f ignores SIGPIPE References: <201212141504.29143.sweet_f_a@gmx.de> In-Reply-To: <201212141504.29143.sweet_f_a@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qBEEXW4U002078 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 13183 Cc: 13183@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) tag 13183 + notabug close 13183 stop On 12/14/2012 02:04 PM, Ruediger Meier wrote: > Hi, > > I want to use tail and grep to follow a file until a particular pattern > appears. But tail does not exit when grep is finished. > > $ echo xxx > /tmp/blabla > $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx" > xxx > > Now tail still tries to read and exits only if I write again > into /tmp/blabla. > > Is this how it's supposed to be? tail does exit on SIGPIPE, however it will only get the signal on write(), and so you need to get more data in the file before tail will exit. thanks, P=E1draig. From unknown Mon Jun 23 13:10:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 12 Jan 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 10 10:15:11 2015 Received: (at control) by debbugs.gnu.org; 10 Feb 2015 15:15:11 +0000 Received: from localhost ([127.0.0.1]:39488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLCWs-0004uH-7m for submit@debbugs.gnu.org; Tue, 10 Feb 2015 10:15:10 -0500 Received: from mail4.vodafone.ie ([213.233.128.170]:55475) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLCWo-0004tO-QS; Tue, 10 Feb 2015 10:15:07 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAIwf2lRtTO4J/2dsb2JhbABcgwaDX8QCgk8CgR5DAQEBAQEBfIQNAQUyAUYQCw0BCgkWDwkDAgECAUUGDQEHAQGILQG/K5EXAQEIAQEBAR6PCm0HhCoBBJlmhT8LjBQig24+gnMBAQE Received: from unknown (HELO localhost.localdomain) ([109.76.238.9]) by mail3.vodafone.ie with ESMTP; 10 Feb 2015 15:14:59 +0000 Message-ID: <54DA2073.2040009@draigBrady.com> Date: Tue, 10 Feb 2015 15:14:59 +0000 From: =?windows-1252?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ruediger Meier Subject: Re: bug#13183: tail -f ignores SIGPIPE References: <201212141504.29143.sweet_f_a@gmx.de> <50CB38B9.1020003@draigBrady.com> In-Reply-To: <50CB38B9.1020003@draigBrady.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 13183@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.0 (/) unarchive 13183 tag 13183 - notabug severity 13183 wishlist On 14/12/12 14:33, Pádraig Brady wrote: > tag 13183 + notabug > close 13183 > stop > > On 12/14/2012 02:04 PM, Ruediger Meier wrote: >> Hi, >> >> I want to use tail and grep to follow a file until a particular pattern >> appears. But tail does not exit when grep is finished. >> >> $ echo xxx > /tmp/blabla >> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx" >> xxx >> >> Now tail still tries to read and exits only if I write again >> into /tmp/blabla. >> >> Is this how it's supposed to be? > > tail does exit on SIGPIPE, however it will > only get the signal on write(), and so you > need to get more data in the file before tail will exit. It's a fair point though that tail, since it can hang around forever should take special steps to be responsive to the other end of the pipe going away. I.E. it might use select() or poll(POLLHUP), to detect immediately/periodically the other end of the pipe going away. Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 15 14:14:44 2015 Received: (at 13183) by debbugs.gnu.org; 15 Feb 2015 19:14:45 +0000 Received: from localhost ([127.0.0.1]:44916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YN4eS-0007WU-Gf for submit@debbugs.gnu.org; Sun, 15 Feb 2015 14:14:44 -0500 Received: from mail5.vodafone.ie ([213.233.128.176]:23844) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YN4eP-0007WF-FD for 13183@debbugs.gnu.org; Sun, 15 Feb 2015 14:14:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8FABXv4FRtTeBf/2dsb2JhbABcgwbHCoJPAoEQQwEBAQEBAXyEDQEFMgFWCw0LCRYPCQMCAQIBRRMIAQGILQG7c5B3iwyEAHQWhBQBBJoHhU0LjB0ig24+gnQBAQE Received: from unknown (HELO localhost.localdomain) ([109.77.224.95]) by mail3.vodafone.ie with ESMTP; 15 Feb 2015 19:14:34 +0000 Message-ID: <54E0F019.5020405@draigBrady.com> Date: Sun, 15 Feb 2015 19:14:33 +0000 From: =?windows-1252?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: 13183@debbugs.gnu.org Subject: Re: bug#13183: tail -f ignores SIGPIPE References: <201212141504.29143.sweet_f_a@gmx.de> <50CB38B9.1020003@draigBrady.com> In-Reply-To: <50CB38B9.1020003@draigBrady.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 13183 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.0 (/) On 14/12/12 14:33, Pádraig Brady wrote: > tag 13183 + notabug > close 13183 > stop > > On 12/14/2012 02:04 PM, Ruediger Meier wrote: >> Hi, >> >> I want to use tail and grep to follow a file until a particular pattern >> appears. But tail does not exit when grep is finished. >> >> $ echo xxx > /tmp/blabla >> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx" >> xxx >> >> Now tail still tries to read and exits only if I write again >> into /tmp/blabla. >> >> Is this how it's supposed to be? > > tail does exit on SIGPIPE, however it will > only get the signal on write(), and so you > need to get more data in the file before tail will exit. It's a fair point though that tail, since it can hang around forever should take special steps to be responsive to the other end of the pipe going away. I.E. it might use select() or poll(POLLHUP), to detect immediately/periodically the other end of the pipe going away. thanks, Pádraig. p.s. bug marked as wishlist From unknown Mon Jun 23 13:10:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 16 Mar 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 12:22:09 2018 Received: (at control) by debbugs.gnu.org; 27 Oct 2018 16:22:09 +0000 Received: from localhost ([127.0.0.1]:45665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGRLl-00078Q-8X for submit@debbugs.gnu.org; Sat, 27 Oct 2018 12:22:09 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:52712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGRLj-00078H-SB for control@debbugs.gnu.org; Sat, 27 Oct 2018 12:22:08 -0400 Received: from localhost.localdomain (unknown [109.79.71.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 73A4B9513 for ; Sat, 27 Oct 2018 17:22:06 +0100 (IST) To: GNU bug tracker automated control server From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <67231bc6-7896-0e5e-1ddd-da931a010894@draigBrady.com> Date: Sat, 27 Oct 2018 09:22:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 13183 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control 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 (+) unarchive 13183 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 12:42:00 2018 Received: (at 13183-done) by debbugs.gnu.org; 27 Oct 2018 16:42:00 +0000 Received: from localhost ([127.0.0.1]:45684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGRex-0001D0-SY for submit@debbugs.gnu.org; Sat, 27 Oct 2018 12:42:00 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:58524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGRew-0001Ct-Jz for 13183-done@debbugs.gnu.org; Sat, 27 Oct 2018 12:41:58 -0400 Received: from localhost.localdomain (unknown [109.79.71.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id E90589A6B for <13183-done@debbugs.gnu.org>; Sat, 27 Oct 2018 17:41:57 +0100 (IST) Subject: Re: bug#13183: tail -f ignores SIGPIPE To: 13183-done@debbugs.gnu.org References: <201212141504.29143.sweet_f_a@gmx.de> <50CB38B9.1020003@draigBrady.com> <54E0F019.5020405@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <26378865-7565-9dda-3cae-a5df1c481a9d@draigBrady.com> Date: Sat, 27 Oct 2018 09:41:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <54E0F019.5020405@draigBrady.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 13183-done 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 (-) On 15/02/15 11:14, Pádraig Brady wrote: > On 14/12/12 14:33, Pádraig Brady wrote: >> tag 13183 + notabug >> close 13183 >> stop >> >> On 12/14/2012 02:04 PM, Ruediger Meier wrote: >>> Hi, >>> >>> I want to use tail and grep to follow a file until a particular pattern >>> appears. But tail does not exit when grep is finished. >>> >>> $ echo xxx > /tmp/blabla >>> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx" >>> xxx >>> >>> Now tail still tries to read and exits only if I write again >>> into /tmp/blabla. >>> >>> Is this how it's supposed to be? >> >> tail does exit on SIGPIPE, however it will >> only get the signal on write(), and so you >> need to get more data in the file before tail will exit. > > It's a fair point though that tail, since it > can hang around forever should take special > steps to be responsive to the other end of the pipe going away. > I.E. it might use select() or poll(POLLHUP), to detect > immediately/periodically the other end of the pipe going away. Implemented in: https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=v8.27-42-gce0415f cheers, Pádraig From unknown Mon Jun 23 13:10:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Nov 2018 12:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator