From unknown Mon Jun 23 04:10:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20542 <20542@debbugs.gnu.org> To: bug#20542 <20542@debbugs.gnu.org> Subject: Status: Differences between q and Q Reply-To: bug#20542 <20542@debbugs.gnu.org> Date: Mon, 23 Jun 2025 11:10:36 +0000 retitle 20542 Differences between q and Q reassign 20542 sed submitter 20542 Paolo Bonzini severity 20542 normal tag 20542 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 10 12:01:11 2015 Received: (at submit) by debbugs.gnu.org; 10 May 2015 16:01:11 +0000 Received: from localhost ([127.0.0.1]:40166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrTfC-00049w-IO for submit@debbugs.gnu.org; Sun, 10 May 2015 12:01:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58013) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrTf9-00049Y-I5 for submit@debbugs.gnu.org; Sun, 10 May 2015 12:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrTf3-0003lV-EE for submit@debbugs.gnu.org; Sun, 10 May 2015 12:01:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrTf3-0003lR-BY for submit@debbugs.gnu.org; Sun, 10 May 2015 12:01:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrTf0-0004EU-52 for bug-sed@gnu.org; Sun, 10 May 2015 12:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrTPw-0007Sh-Iv for bug-sed@gnu.org; Sun, 10 May 2015 11:45:25 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:35654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrTPq-0007RK-KB; Sun, 10 May 2015 11:45:18 -0400 Received: by widdi4 with SMTP id di4so79237783wid.0; Sun, 10 May 2015 08:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/WlYIR+s08PUzJli/sa2I7+bZ3R0PwUdEhV4piZmCMc=; b=nFGv+u1RaDIu/GasgjrBIoD+X2z8dRzq6+kpwtdzE5kPGxuUCSzSfezmckUxPd3FIY uy+bBG3NQmRDU6yXsPWbmQH11WJ+T1Nxcdq4lQTG6WIbNEUW9FVW3uw6VDqyw50y+4k8 BBZyz1ULPx+o0/kHQ70vbjgNOh56Sbk/dERtb384YkhH9PED9tfn6bRkvFNYRyAoWyRX ztno8mitXIZ/u1sI/iedATO0SPOdY6S/1Hx8khce7UpmpT7rqSLHQqYAuYihJuZEtLzA BCUdM+4CHccZsbMtxuLmXI2eY03eS8g6NyR7FnuYuiFDRyCJCfqDCc1ZH+AL3l35ZCpi 5ScQ== X-Received: by 10.194.62.5 with SMTP id u5mr13101872wjr.41.1431272717717; Sun, 10 May 2015 08:45:17 -0700 (PDT) Received: from [192.168.10.165] (dynamic-adsl-94-39-186-233.clienti.tiscali.it. [94.39.186.233]) by mx.google.com with ESMTPSA id r9sm18508749wjo.26.2015.05.10.08.45.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2015 08:45:16 -0700 (PDT) Message-ID: <554F7D0A.6070302@gnu.org> Date: Sun, 10 May 2015 17:45:14 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: sed-users@yahoogroups.com, bug-sed@gnu.org, jemarch@gnu.org Subject: Re: Differences between q and Q References: <20150508164133.06daf895@bigbox.christie.dr> <554EE79A.2030304@ehdp.com> In-Reply-To: <554EE79A.2030304@ehdp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -4.0 (----) On 10/05/2015 07:07, Daniel Goldman dgoldman@ehdp.com [sed-users] wrote: > Again, to repeat, the purpose of my post (based on emails I received) > was to suggest that the GNU sed manual be corrected to read "Note that > the current pattern space is printed if auto-print is not disabled with > the -n options. Also, scheduled text is printed." for q, and "This > command is the same as q, but will not print the contents of pattern > space, nor any scheduled text." for Q. If anyone has comments on this > admittedly minor correction, that would be great. If no comments, that's > OK too. :) Yes, this is a good change. I'm CCing the current GNU sed maintainer so that he can work it out into a patch. By the way, there is another command ("d") that suppresses scheduled text. Paolo From debbugs-submit-bounces@debbugs.gnu.org Sun May 10 17:04:25 2015 Received: (at submit) by debbugs.gnu.org; 10 May 2015 21:04:25 +0000 Received: from localhost ([127.0.0.1]:40248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrYOe-0002zX-Cs for submit@debbugs.gnu.org; Sun, 10 May 2015 17:04:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41726) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrYOb-0002zJ-J6 for submit@debbugs.gnu.org; Sun, 10 May 2015 17:04:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrYOV-0004LS-4G for submit@debbugs.gnu.org; Sun, 10 May 2015 17:04:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrYOV-0004LO-1I for submit@debbugs.gnu.org; Sun, 10 May 2015 17:04:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrYOT-0002Ry-Ry for bug-sed@gnu.org; Sun, 10 May 2015 17:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrYOQ-0004KS-Gf for bug-sed@gnu.org; Sun, 10 May 2015 17:04:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:64739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrYOQ-0004KI-71 for bug-sed@gnu.org; Sun, 10 May 2015 17:04:10 -0400 Received: from xdb.me ([88.12.60.209]) by mail.gmx.com (mrgmx001) with ESMTPA (Nemesis) id 0M9K5G-1YwXXq0S34-00CkJz for ; Sun, 10 May 2015 23:04:08 +0200 Date: Sun, 10 May 2015 23:04:04 +0200 From: Davide Brini To: bug-sed@gnu.org Subject: Re: bug#20542: Differences between q and Q In-Reply-To: <554F7D0A.6070302@gnu.org> References: <20150508164133.06daf895@bigbox.christie.dr> <554EE79A.2030304@ehdp.com> <554F7D0A.6070302@gnu.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID: <0MGAdz-1Z2s8t1cF5-00FC6A@mail.gmx.com> X-Provags-ID: V03:K0:qdiWGWZ2gYdilxCgULzLUnLBmmixCK8gulUTOqV/CIATgE+E6ds yjcxLPCqfe47dhSl5GkwX494m7Hlc3GQUIgx+HuFmiX5+CvnT2mYFg2/nFiRDt3U85ilykP 1ZFgtQ08LQASehkk2ArIsllgy8kGeQcrRy3y5jXSv+5KkbbbLzNAbfbtfkjugwKul9k0VMr q5lB4eze6WtkDC4hBsy/w== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit 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: -4.1 (----) On Sun, 10 May 2015 17:45:14 +0200, Paolo Bonzini wrote: > > > On 10/05/2015 07:07, Daniel Goldman dgoldman@ehdp.com [sed-users] wrote: > > Again, to repeat, the purpose of my post (based on emails I received) > > was to suggest that the GNU sed manual be corrected to read "Note that > > the current pattern space is printed if auto-print is not disabled with > > the -n options. Also, scheduled text is printed." for q, and "This > > command is the same as q, but will not print the contents of pattern > > space, nor any scheduled text." for Q. If anyone has comments on this > > admittedly minor correction, that would be great. If no comments, > > that's OK too. :) > > Yes, this is a good change. I'm CCing the current GNU sed maintainer so > that he can work it out into a patch. > > By the way, there is another command ("d") that suppresses scheduled text. Doesn't seem to affect the "a", "i" and "c" commands (I'm not sure this is as it should be): $ echo x | sed -e 'a y' -e d y $ echo x | sed -e 'i y' -e d y $ echo x | sed -e 'c y' -e d y $ sed --version sed (GNU sed) 4.2.2 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . ... -- D. From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 04:07:24 2015 Received: (at submit) by debbugs.gnu.org; 11 May 2015 08:07:24 +0000 Received: from localhost ([127.0.0.1]:40527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrikF-0006kO-5T for submit@debbugs.gnu.org; Mon, 11 May 2015 04:07:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42515) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrikB-0006k8-TZ for submit@debbugs.gnu.org; Mon, 11 May 2015 04:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrik5-0000nv-BK for submit@debbugs.gnu.org; Mon, 11 May 2015 04:07:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrik5-0000nr-8l for submit@debbugs.gnu.org; Mon, 11 May 2015 04:07:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrik4-0007gS-5C for bug-sed@gnu.org; Mon, 11 May 2015 04:07:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrik0-0000m1-5j for bug-sed@gnu.org; Mon, 11 May 2015 04:07:12 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:34517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrijz-0000lj-Rx for bug-sed@gnu.org; Mon, 11 May 2015 04:07:08 -0400 Received: by wgic8 with SMTP id c8so93695498wgi.1 for ; Mon, 11 May 2015 01:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=goQ73V5Dt2j6pXfBbPGO0vZd8Tuaxre38iY9qrr7T9k=; b=aKtJKw1vsTFb16S40l9Ln/Mc8SEjbHWXKu29eTQQPsAjFztNtFAwrAANDeXVyAs1bx qSwKmUZTL7p1t3j5Dlj1lCyP68wJOQrYgZGNpQOHJBr2kUAuQ2HxaXEUTHkRGzCsszY7 /3EK4WEmZarYtN73ruw6FlX8pkzMcMy5ak18YZ+lYewDf7EvTk29EonhRIDfELLnvWI3 Y9raE/EBRLMyLNH739e40ibbamYXgYgubH9MUAztykP7k3ioD9g0y3D/wFFluOXpLlbw ExJnG5morxZRPPgw5wEgYUYaes+hiScq6D5a2DHRG7y/2RlRFgi1+ATRdYsSZ3Prxyxm mgHA== X-Received: by 10.194.63.80 with SMTP id e16mr18200380wjs.56.1431331627353; Mon, 11 May 2015 01:07:07 -0700 (PDT) Received: from [192.168.10.165] (dynamic-adsl-94-39-186-233.clienti.tiscali.it. [94.39.186.233]) by mx.google.com with ESMTPSA id kc4sm21546697wjc.2.2015.05.11.01.07.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 01:07:05 -0700 (PDT) Message-ID: <55506327.4090503@gnu.org> Date: Mon, 11 May 2015 10:07:03 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Daniel Goldman , bug-sed@gnu.org Subject: Re: Differences between q and Q References: <20150508164133.06daf895@bigbox.christie.dr> <554EE79A.2030304@ehdp.com> <554F7D0A.6070302@gnu.org> <555017CA.80708@ehdp.com> In-Reply-To: <555017CA.80708@ehdp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -4.0 (----) On 11/05/2015 04:45, Daniel Goldman wrote: > Hi Paolo, > > You are right that this minor point also affects d, but d doesn't seem > to suppress output, if that was your point. Of course, d deletes > PatSpace and ends the script, so AutoPrint does nothing. But the point > is that d does not suppress scheduled text: > > $ echo y | sed -e ix -e az -e d > x > z > > z (the scheduled text) is still printed. So the definition for d should > probably be reworded to: "Delete the pattern space; print any scheduled > output; start next cycle." Interesting. I would have thought that "d" suppresses the scheduled text and "D" doesn't. But I was remembering wrong. In retrospect, "Q" should then _not_ have suppressed the scheduled text. The idea of "Q" was basically "same as d, but quit instead of starting the next cycle". I guess horses are out here, or do you think that "Q" should be fixed? Paolo > Of course, the same applies to D - The manual is silent concerning > scheduled text, possibly implying that it is not printed. It should > probably say for D: "Otherwise, delete text in the pattern space up to > the first newline, print any scheduled text, and restart cycle with the > resultant pattern space, without reading a new line of input." > > The c command is also affected. Again, if there happens to be any > scheduled text (admittedly probably would never happen), it gets printed > before the next Cycle starts. So the manual should probably say: "After > printing any scheduled text, a new cycle is started after this command > is done, since the pattern space will have been deleted." > > Thierry Blanc suggested that the i command might be affected. It is not. > Of course, as documented in the manual, for some reason, i does not > schedule output, instead immediately prints. Only arR schedule. > > This is all rather obscure, of course. In all my years of sed usage, > these circumstances have never arisen. So I think the manual was > basically OK before. But it makes sense the manual should get all the > details right, as the reference document, even if including all the gory > details bogs things down a bit. FWIW, I am adding the details to any > future edition of the "Definitive Guide" book, and will list the changes > on the errata page. > > Perhaps equally obscure was the observation that Q is apparently the > only command that suppresses scheduled output. > > If you want me to post again to the sed-users group, I could, or you > could handle it as you choose. Just let me know your preference. > > I hope things are going well there in beautiful Italy. Life goes on fine > here in Seattle. > > Thanks, > Daniel > > On 5/10/2015 8:45 AM, Paolo Bonzini bonzini@gnu.org [sed-users] wrote: >> >> >> On 10/05/2015 07:07, Daniel Goldman dgoldman@ehdp.com [sed-users] wrote: >>> Again, to repeat, the purpose of my post (based on emails I received) >>> was to suggest that the GNU sed manual be corrected to read "Note that >>> the current pattern space is printed if auto-print is not disabled with >>> the -n options. Also, scheduled text is printed." for q, and "This >>> command is the same as q, but will not print the contents of pattern >>> space, nor any scheduled text." for Q. If anyone has comments on this >>> admittedly minor correction, that would be great. If no comments, that's >>> OK too. :) >> >> Yes, this is a good change. I'm CCing the current GNU sed maintainer so >> that he can work it out into a patch. >> >> By the way, there is another command ("d") that suppresses scheduled >> text. >> >> Paolo >> >> >> ------------------------------------ >> >> ------------------------------------ >> > From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 18:17:24 2015 Received: (at submit) by debbugs.gnu.org; 11 May 2015 22:17:24 +0000 Received: from localhost ([127.0.0.1]:41343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yrw0p-0003yR-RW for submit@debbugs.gnu.org; Mon, 11 May 2015 18:17:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42426) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yrvwm-0003qe-2Q for submit@debbugs.gnu.org; Mon, 11 May 2015 18:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrvwf-0002Km-HR for submit@debbugs.gnu.org; Mon, 11 May 2015 18:13:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrvwf-0002Ki-Ez for submit@debbugs.gnu.org; Mon, 11 May 2015 18:13:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrvwe-0008Bh-BF for bug-sed@gnu.org; Mon, 11 May 2015 18:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrvwa-0002Em-Dy for bug-sed@gnu.org; Mon, 11 May 2015 18:13:04 -0400 Received: from mail.centurylink.net ([205.219.233.9]:43629 helo=smtp.centurylink.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrvwa-0002EZ-9n for bug-sed@gnu.org; Mon, 11 May 2015 18:13:00 -0400 X_CMAE_Category: , , X-CNFS-Analysis: v=2.0 cv=ROox7ve+ c=1 sm=1 a=m14GuLjYcDRc/Gi9scHfng==:17 a=ygNaTn0in3EA:10 a=N659UExz7-8A:10 a=HxGJTuPrAAAA:8 a=H1WQJnOEM52kOnDtwLsA:9 a=pILNOxqGKmIA:10 a=m14GuLjYcDRc/Gi9scHfng==:117 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: dml0YWxuZXRAY2VudHVyeWxpbmsubmV0 Authentication-Results: smtp01.agate.dfw.synacor.com smtp.user=vitalnet@centurylink.net; auth=pass (LOGIN) Received: from [75.165.58.82] ([75.165.58.82:26708] helo=[192.168.0.7]) by smtp.centurylink.net (envelope-from ) (ecelerity 3.5.1.37854 r(Momo-dev:3.5.1.0)) with ESMTPSA (cipher=AES128-SHA) id FC/77-21563-96921555; Mon, 11 May 2015 18:12:58 -0400 Message-ID: <55512967.7030500@ehdp.com> Date: Mon, 11 May 2015 15:12:55 -0700 From: Daniel Goldman User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Paolo Bonzini , bug-sed@gnu.org Subject: Re: Differences between q and Q References: <20150508164133.06daf895@bigbox.christie.dr> <554EE79A.2030304@ehdp.com> <554F7D0A.6070302@gnu.org> <555017CA.80708@ehdp.com> <55506327.4090503@gnu.org> In-Reply-To: <55506327.4090503@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 11 May 2015 18:17:21 -0400 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: -4.1 (----) On 5/11/2015 1:07 AM, Paolo Bonzini wrote: > > Interesting. I would have thought that "d" suppresses the scheduled > text and "D" doesn't. But I was remembering wrong. > > In retrospect, "Q" should then _not_ have suppressed the scheduled text. > The idea of "Q" was basically "same as d, but quit instead of starting > the next cycle". I guess horses are out here, or do you think that "Q" > should be fixed? > > Paolo > When Anders Granlund wrote me, I also remembered some things wrong. But I think I was remembering things the way that made sense to me. --------- Should Q suppress scheduled output? One could argue that Q means "Bail out immediately". That is what it does right now, including suppressing scheduled output. Or one could argue that the decision to schedule output was already made and should be honored. If Q was indeed modeled after d, then that is a good reason not to suppress scheduled output, assuming that d works "correctly". --------- Does d work correctly? The original paper by Lee McMahon said - The d function deletes from the file (does not write to the output) all those lines matched by its address(es). It also has the side effect that no further commands are attempted on the corpse of a deleted line; as soon as the d function is executed, a new line is read from the input, and the list of editing commands is re-started from the beginning on the new line. Read literally, "as soon as the d function is executed, a new line is read from the input" argues that d should suppress scheduled output. There is no room in that statement for scheduled output to be printed. On the other hand, I kind of doubt that Lee McMahon had a grand scheme for everything, had everything planned out. --------- Maybe i should be scheduled? I always thought of i and a being closely related. But i does not schedule output, so is not that close. Again from the McMahon paper - The i function behaves identically to the a function, except that is written to the output before the matched line. All other comments about the a function apply to the i function as well. Well, "identically" and "all other comments apply" suggest to me that i should also schedule output for later. If I was designing the language, that's how I would do it. Currently, we have: $ echo y | sed -e ix -e p x y y So currently, i prints immediately, just like the GNU sed manual says. But I think it should be like this: $ echo y | sed -e ix -e p y x y The proposed alternate would have i schedule to print before AutoPrint ("before the matched line"), analogous to a, and in accord with what was originally written by McMahon. ------------------- My opinions I think scheduled output should always get printed. So I think Q should be "fixed" so that scheduled output is printed. I think d should stay as it is (print scheduled output), regardless of possibly mistaken wording by Lee McMahon. I think i should schedule (not immediately print) output, analogous to a, and in accord with how the language was apparently intended. -------------- I have never used Q and probably never will. I do use the i command. But the suggested change to schedule i output would probably never affect me, due to the utilitarian way I normally use sed. In other words, if things stayed as they are right now, as the horses are already out there, I would be fine with that. I wouldn't want to break anybody's incredibly imaginative existing sed script. Thanks, Daniel From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 24 22:38:11 2017 Received: (at control) by debbugs.gnu.org; 25 Jan 2017 03:38:11 +0000 Received: from localhost ([127.0.0.1]:41336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWEPT-0005Kg-1j for submit@debbugs.gnu.org; Tue, 24 Jan 2017 22:38:11 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:36247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWEPR-0005KO-Hn; Tue, 24 Jan 2017 22:38:09 -0500 Received: by mail-qk0-f173.google.com with SMTP id 11so62972268qkl.3; Tue, 24 Jan 2017 19:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=2gWvOc/TYyPkuC6FImvD2dmde9kUyDpJsjPgH2Lw/mQ=; b=O0YoHsAHJLrcrEr/V5mWgrZFODp3960JUqUBFyzE2Nml9BE6dv+B3CB8ZC+shmybxg kRQAQKGknqLqRE20xDs1ssErRJ1UVhKZJu8DmDNH36CrNoP9UhgXFIgWGSh5r/M9NK/B eS36ITTBQvG6lKdfCSPIjcLmCuTJqGUD6hckwRYPxcOhOa9ONyBdUkKRZ5hMmge2LCAX vy/SGiJXo2mZDi0htXr+Emhjm5e5odgup2RJl7SknBh1LtkWyAm0jGzSPv80iKp2OzIJ rQzz1ydbcEl+VRsQ6WtmKc/tydhYiT90ro+CXHV4asptgRHC7RomokRE+HZ4wi8DidD6 8h8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=2gWvOc/TYyPkuC6FImvD2dmde9kUyDpJsjPgH2Lw/mQ=; b=nkaD3gcOjTy3MCyrVWbB801FGAT3ycTxShaCbSHnfFMH+EKpC6iUYEv3xEn3os2EOx J+8We2rcYkaC3pJkDcdKcQPVYSTKd+CtN1R9TecHPEI+d1z/FJqemTexZgtMk/F4ikH0 WHLFbDzgAW5eDdrKNRxoxc3hoSDGy1ba03cHPBmmyJzrJAyoKCScrXwBuLCEZxyuUuS1 9Bu2pX8HqPw5Suj/F27sKBwMa3YdVcpn4xChyliZDkTWsOmFRez2WaBCo2wKHgekqg47 b1tmQcdkQQg8rDVC8LHabmvNfJ9EEkmVBhBG6CvqB6irEX68vfoLN2Fn5KHtb1GldRhy BRJw== X-Gm-Message-State: AIkVDXKaoUo2BINMoJELJNYQ9yS/+/1i2+B+WVX0MVpLrHdbJOAOPnLiN8eWVbIalicT7g== X-Received: by 10.233.235.214 with SMTP id b205mr34298345qkg.156.1485315483948; Tue, 24 Jan 2017 19:38:03 -0800 (PST) Received: from gmail.com (housegordon.org. [104.236.108.240]) by smtp.gmail.com with ESMTPSA id t7sm17058611qtb.11.2017.01.24.19.38.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 19:38:03 -0800 (PST) Date: Wed, 25 Jan 2017 03:37:32 +0000 From: Assaf Gordon To: 20542-done@debbugs.gnu.org Subject: Re: Differences between q and Q Message-ID: <20170125033731.GI9668@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -0.2 (/) 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: -0.2 (/) tags 20542 wontfix close 20542 stop Hello Daniel, Paolo and all, Daniel Goldman wrote: > In other words, if things stayed as they are right now, as the horses > are already out there, I would be fine with that. I wouldn't want to > break anybody's incredibly imaginative existing sed script. Based on this conclusion, I'm closing this bug and marking it as 'wont fix'. If things change we can always re-open it. Thank you for an interesting discussion about sed's internals. I hope to expand gnu sed's manual soon with information about cycles and scheduled output, and I'll certainly refer to this thread. regards, - assaf From unknown Mon Jun 23 04:10:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 22 Feb 2017 12:24:05 +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