From unknown Wed Jun 18 23:14:23 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#20095 <20095@debbugs.gnu.org> To: bug#20095 <20095@debbugs.gnu.org> Subject: Status: conditional branching Reply-To: bug#20095 <20095@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:14:23 +0000 retitle 20095 conditional branching reassign 20095 sed submitter 20095 Erik Popp severity 20095 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 12 02:53:12 2015 Received: (at submit) by debbugs.gnu.org; 12 Mar 2015 06:53:12 +0000 Received: from localhost ([127.0.0.1]:43383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVwzX-0003Qg-UV for submit@debbugs.gnu.org; Thu, 12 Mar 2015 02:53:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43681) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVwrI-0003DU-01 for submit@debbugs.gnu.org; Thu, 12 Mar 2015 02:44:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVwrB-0003ee-LR for submit@debbugs.gnu.org; Thu, 12 Mar 2015 02:44:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_50,DATE_IN_PAST_03_06, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVwrB-0003ea-IE for submit@debbugs.gnu.org; Thu, 12 Mar 2015 02:44:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVwrA-0001D7-8B for bug-sed@gnu.org; Thu, 12 Mar 2015 02:44:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVwr6-0003db-7A for bug-sed@gnu.org; Thu, 12 Mar 2015 02:44:32 -0400 Received: from [193.150.121.27] (port=43045 helo=mail01.sigterm.no) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVwr5-0003cd-Sg for bug-sed@gnu.org; Thu, 12 Mar 2015 02:44:28 -0400 Received: from smtp.postman.i2p (unknown [193.150.121.26]) by postman.meeh.i2p (Postfix) with ESMTP id 9E3AF2E340B for ; Thu, 12 Mar 2015 07:06:24 +0100 (CET) X-Virus-Scanned: clamav-milter 0.97 on milter.postman.i2p X-Mailer: smtp.postman.i2p - Official I2P Mailer From: Erik Popp MIME-Version: 1.0 To: bug-sed@gnu.org Subject: conditional branching Content-Type: multipart/mixed; boundary="------------070808050600000502020101" Message-Id: <20150312024207.0A11CAE3E3@smtp.postman.i2p> Date: Thu, 12 Mar 2015 02:42:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-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: -3.0 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 12 Mar 2015 02:53:10 -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: -3.0 (---) This is a multi-part message in MIME format. --------------070808050600000502020101 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm using sed to verify that a log file is in the correct format, to make it impossible for crafted input to cause any problems in a shell script.

I'm stumped, and the only explanation that I can think of for why my script isn't working is that sed's "t" command is not working properly.

If I comment out any 2 of the 3 main commands, the output is as expected:
  • white space stripper always "succeeds", and thus the script jumps to the success section
  • curly brace detector jumps to the "success" section if triggered.=C2=A0 otherwise, the t command fails, because there wa= sn't a substitution in the first place
  • entry converter succeeds if format of entry is valid, assuming that there isn't any surrounding white space
However, if I un-comment all 3 of the main commands, the script doesn't fail when input is invalid.=C2=A0 Instead, it spits out the un-transformed invalid input, as if it was valid.

Am I missing something, or is this a bug?
--------------070808050600000502020101 Content-Type: text/x-log; name="filesystem-events.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="filesystem-events.log" { .event: "MODIFY", filename: "def.txt", processed: "n", time: "2014 December 19 20:06:10", watched_directory: "test/source/" } --------------070808050600000502020101 Content-Type: text/plain; charset=UTF-8; name="log-filter.sed" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="log-filter.sed" IyEvYmluL3NlZCAtbnJmCgojbG9nLWZpbHRlci5zZWQKI3RoaXMgaXMgdXNlZCBieSBhIHNo ZWxsIHNjcmlwdCBmb3IgcGFyc2luZyBpbnB1dCwgYW5kIGZpbHRlcmluZyBvdXQgYW55IGlu dmFsaWQgaW5wdXQKI2NyZWF0ZWQgYnkgRXJpayBQb3BwCiNlcG9wcEBpMnBtYWlsLm9yZwoK I3JlYXJyYW5nZSBpbnB1dCBpbnRvIHRoZSBmb3JtYXQgdGhhdCB0aGUgY29tbWFuZCBwYXJz ZXIgZXhwZWN0czogcHJvcGVydHlfbmFtZSx2YWx1ZQoKI0kgdHJpZWQgdG8gcHJldmVudCBh bnkgcG90ZW50aWFsIHNlY3VyaXR5IGZsYXdzIGZyb20gY3JhZnRlZCBpbnB1dCBieToKIyAt IGV4YWN0bHkgbWF0Y2hpbmcgYWxsb3dhYmxlIHByb3BlcnRpZXMsIGluc3RlYWQgb2YgcmVt b3ZpbmcgYWxsIHRoZSBwb3NzaWJsZSBpbnZhbGlkIG9uZXMgdGhhdCBJIGNvdWxkIHRoaW5r IG9mCiMgLSByZXN0cmljdGluZyB0aGUgYWxsb3dlZCBjaGFyYW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SBnZXQgdG8gdGhpcyBwb2ludCBpZiB0aGUgaW5wdXQgd2FzIHZhbGlkCgo6c3VjY2Vzcwpw Cg== --------------070808050600000502020101-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 12 05:01:59 2015 Received: (at submit) by debbugs.gnu.org; 12 Mar 2015 09:01:59 +0000 Received: from localhost ([127.0.0.1]:43432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVz0A-0006cY-Fs for submit@debbugs.gnu.org; Thu, 12 Mar 2015 05:01:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40155) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YVz08-0006cL-H2 for submit@debbugs.gnu.org; Thu, 12 Mar 2015 05:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVyzw-0005Xt-H1 for submit@debbugs.gnu.org; Thu, 12 Mar 2015 05:01:51 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:50122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyzw-0005Xj-F6 for submit@debbugs.gnu.org; Thu, 12 Mar 2015 05:01:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyzv-0002ES-4K for bug-sed@gnu.org; Thu, 12 Mar 2015 05:01:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVyzp-0005SL-6K for bug-sed@gnu.org; Thu, 12 Mar 2015 05:01:43 -0400 Received: from mout.gmx.net ([212.227.17.22]:54656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyzo-0005R0-SJ for bug-sed@gnu.org; Thu, 12 Mar 2015 05:01:37 -0400 Received: from zoot.sax ([88.87.214.78]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LrevR-1ZYi1J16Fx-013OKK for ; Thu, 12 Mar 2015 10:01:32 +0100 Date: Thu, 12 Mar 2015 10:01:31 +0100 From: Davide Brini To: bug-sed@gnu.org Subject: Re: bug#20095: conditional branching In-Reply-To: <20150312024207.0A11CAE3E3@smtp.postman.i2p> References: <20150312024207.0A11CAE3E3@smtp.postman.i2p> 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=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID: <0LtZfc-1ZWmDI1V1o-010uQH@mail.gmx.com> X-Provags-ID: V03:K0:iHW0hhTR5Xc0jFG79aDMp5ua7g21c6FmZ2KkWyfGG0P6uUkUGsq kuiRIFyAI4vMvwq75BW3SlFrKLtvvknyzjUykRlwco0hEdwwWi/YZABVvMQtotltPXN/kKR cNte0fru9CHkBSr2xhLjqkqBtUZo3xLb4VtOUzJ3hC8CD855CvVrIcm+MreWdcIqRujEiqG CBCM2SkYGNxY8jQ/AV0pw== 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: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 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 Thu, 12 Mar 2015 02:42:07 +0000 (UTC), Erik Popp wrote: > I'm using sed to verify that a log file is in the correct format, to make > it impossible for crafted input to cause any problems in a shell script. >=20 > I'm stumped, and the only explanation that I can think of for why my > script isn't working is that sed's "t" command is not working properly. >=20 > If I comment out any 2 of the 3 main commands, the output is as expected: > white space stripper always "succeeds", and thus the script jumps to the > success section curly brace detector jumps to the "success" section if > triggered.=C2=A0 otherwise, the t command fails, because there wasn't a > substitution in the first place entry converter succeeds if format of > entry is valid, assuming that there isn't any surrounding white space > However, if I un-comment all 3 of the main commands, the script doesn't > fail when input is invalid.=C2=A0 Instead, it spits out the un-transformed > invalid input, as if it was valid. >=20 > Am I missing something, or is this a bug? If I understand correctly (I've had only a quick look at the code): the description for the "t" command says Branch to LABEL only if there has been a successful `s'ubstitution since the last input line was read or conditional branch was taken. The LABEL may be omitted, in which case the next cycle is started. (note: since the last conditional branch was taken) which, in simple terms, means that with this sample code: s/foo/bar/ s/xxx/yyy/ t successxxx the code will branch to :successxxx if *either* substitution succeeds. For this reason it's sometimes needed to "reset" the state of the "t" command, so to speak, as follows: s/foo/bar/ t successfoo :successfoo s/xxx/yyy/ t successxxx with this modification, the code will branch to :successxxx only if the last substitution succeeds. --=20 D. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 16:43:16 2015 Received: (at 20095) by debbugs.gnu.org; 14 Mar 2015 20:43:17 +0000 Received: from localhost ([127.0.0.1]:46840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWstw-00059v-6j for submit@debbugs.gnu.org; Sat, 14 Mar 2015 16:43:16 -0400 Received: from [193.150.121.27] (port=37717 helo=mail01.sigterm.no) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWstt-00059k-U9 for 20095@debbugs.gnu.org; Sat, 14 Mar 2015 16:43:15 -0400 Received: from smtp.postman.i2p (unknown [193.150.121.26]) by postman.meeh.i2p (Postfix) with ESMTP id 215CE2E3410 for <20095@debbugs.gnu.org>; Sat, 14 Mar 2015 21:43:10 +0100 (CET) X-Virus-Scanned: clamav-milter 0.97 on milter.postman.i2p X-Mailer: smtp.postman.i2p - Official I2P Mailer From: Erik Popp MIME-Version: 1.0 To: 20095@debbugs.gnu.org Subject: sed conditional branching Content-Type: multipart/mixed; boundary="------------020902030907060308040807" Message-Id: <20150314194759.16B82AE3F4@smtp.postman.i2p> Date: Sat, 14 Mar 2015 19:47:59 +0000 (UTC) X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A couple of days ago, I sent a bug report to bug-sed@gnu.org, but it was late enough at night that I did a bad job of explaining what was wrong. I also forgot to include the word "sed" in the subject line. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 20095 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: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: A couple of days ago, I sent a bug report to bug-sed@gnu.org, but it was late enough at night that I did a bad job of explaining what was wrong. I also forgot to include the word "sed" in the subject line. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS This is a multi-part message in MIME format. --------------020902030907060308040807 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit A couple of days ago, I sent a bug report to bug-sed@gnu.org, but it was late enough at night that I did a bad job of explaining what was wrong.  I also forgot to include the word "sed" in the subject line.

Here's take 2:
  • I'm using sed to filter a log, before passing it to the next part of a shell script
  • It appears that sed's "t" command doesn't work properly under some situations
  • The log file's format is almost identical to JSON:
    • {
      property: "value",
      property2: "value",
      ...
      lastproperty: "value"
      }

      {
      property_of_next_entry: "value",
      ...
  • The sed script does 2 things:
    • Block any invalid entries
    • Transform the log's data into a format that's easy for a shell script to process:
      property_name,value
  • sed options:
    sed -nrf log-filter.sed
  • sed version:
    GNU sed 4.2.2
  • uname -a
    Linux yum 3.13.0-40-generic #69-Ubuntu SMP Thu Nov 13 17:56:26 UTC 2014 i686 athlon i686 GNU/Linux
  • There are 4 commands that are relevant:
    • Trim white space from both sides
      s/^[ 	]*|[ 	]*$//g
    • If the line is a curly brace, jump to success handler
      /^[{}]$/ b success
    • If the line is in the correct format for a JSON property: "value" pair, rearrange the property and value into a format that's easy for a shell script to process
      s/^([A-Za-z_\-]+):[ 	]*"([A-Za-z0-9 _\-\.\:\/]*)",?$/\1,\2/
    • If the above substitution succeeds, jump to success handler
      t success
      
  • The script is structured so that it should print nothing unless the script branches to a success handler.  After the above-mentioned commands, there's a "d" command.  The success handler is below that.
  • The first 3 above-mentioned components work properly individually.  Of particular relevance is that if I comment out the white space remover, and also the curly brace handler, so that the first command that runs is the JSON property verifier, the "t" command works properly.  Input that matches it causes the "t" command to jump to the success handler, while input that doesn't causes it to fall through to the "d" command, as designed.
  • If I run these 4 commands in sequence, the "t" command always succeeds, even if the substitution right above it fails.  It's as if on the back end of the "t" command, sed checks if any substitution in the whole script has succeed on this line, and branches if any did.  Since the white space remover line "succeeds" pretty much all the time, this would explain the symptom.

--------------020902030907060308040807 Content-Type: text/plain; charset=UTF-8; name="log-filter.sed" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="log-filter.sed" IyEvYmluL3NlZCAtbnJmCgojbG9nLWZpbHRlci5zZWQKI3RoaXMgaXMgcGFydCBvZiB0aGUg cHJvZ3JhbSAicH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raXAgdG8gdGhlIHByaW50IGNvbW1hbmQKdCBwcmlu dAoKI2lmIHRoZSBwcmV2aW91cyBzdWJzdGl0dXRpb24gZmFpbGVkLCBvdXRwdXQgYW4gZXJy b3IgbWVzc2FnZQoKI3MvLiovZXJyb3IsJi8KCiNkZWxldGUgdGhlIGNvbnRlbnRzIG9mIHRo ZSBwYXR0ZXJuIHNwYWNlLCB0aHVzIGltcGxpY2l0bHkgbW92aW5nIG9uIHRvIHRoZSBuZXh0 IGxpbmUKCmQKCiN0aGUgc2NyaXB0IHNob3VsZCBvbmx5IGdldCB0byB0aGlzIHBvaW50IGlm IHRoZSBwcmV2aW91cyBzdWJzdGl0dXRpb24gd2FzIGEgc3VjY2VzcwoKOnByaW50CnAK --------------020902030907060308040807 Content-Type: text/plain; charset=UTF-8; name="filesystem-events.log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="filesystem-events.log" ewogIC5ldmVudDogIk1PRElGWSIsCiAgZmlsZW5hbWU6ICJkZWYudHh0IiwKICBwcm9jZXNz ZWQ6ICJuIiwKICB0aW1lOiAiMjAxNCBEZWNlbWJlciAxOSAyMDowNjoxMCIsCiAgd2F0Y2hl ZF9kaXJlY3Rvcnk6ICJ0ZXN0L3NvdXJjZS8iCn0K --------------020902030907060308040807-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 10 13:16:34 2015 Received: (at 20095-done) by debbugs.gnu.org; 10 May 2015 17:16:34 +0000 Received: from localhost ([127.0.0.1]:40207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrUq9-0005xE-JW for submit@debbugs.gnu.org; Sun, 10 May 2015 13:16:33 -0400 Received: from mail-ig0-f176.google.com ([209.85.213.176]:36795) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrUq7-0005x0-39 for 20095-done@debbugs.gnu.org; Sun, 10 May 2015 13:16:31 -0400 Received: by igbpi8 with SMTP id pi8so53691282igb.1 for <20095-done@debbugs.gnu.org>; Sun, 10 May 2015 10:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=JOBZZ0w7pa35+blMeliyArzRWZUn1S1I9xDgE5+P+60=; b=UI9YyXYp600AIAPEsU6LVdJxOKHOm6oYddCw5SGpiGfYFAFHspmHkD4C6yErviGB+R x6vwJcDbv4U2qKRHW9thCr5ds8xMjC8lYmL/14qugQJPcFApP6P9lMp63o8bhCaT9/eO QJNcAR99tj0P7FgbV5xKEFsqDHQHVUucvsZcSZLcjIyx8RFxsa/yXG6L2S51sfACMH93 Dz9vLT6d64lIIU4pMevCMma4kUPBoqClxvI/r0sxk2gopJF0qRDSkF2/QMDO8TVfyNiX ENBWYNuYwFVoCRLlDmhkn3Tqpojo8whrli0CDUI9zlm9DfX1M7CJkia2AEC/ipWzm4V3 rM8A== X-Received: by 10.50.73.198 with SMTP id n6mr10010543igv.32.1431278185671; Sun, 10 May 2015 10:16:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.62.229 with HTTP; Sun, 10 May 2015 10:16:05 -0700 (PDT) From: Jim Meyering Date: Sun, 10 May 2015 10:16:05 -0700 X-Google-Sender-Auth: O5HD_8B2k3V_QuRfk9ZpO4x9EUI Message-ID: Subject: Re: sed conditional branching To: Erik Popp , 20095-done@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20095-done 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.7 (/) tags 20095 notabug thanks Davide Brini's analysis at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20095#8 is correct. "t" works like this: 't LABEL' Branch to LABEL only if there has been a successful 's'ubstitution since the last input line was read or conditional branch was taken. The LABEL may be omitted, in which case the next cycle is started. yet your script expects it to work differently. Hence, I'm marking this issue as a non-bug and closing it. However, you are welcome to reply here; any comments will be logged at https://bugs.gnu.org/20095. From debbugs-submit-bounces@debbugs.gnu.org Mon May 11 01:38:53 2015 Received: (at 20095) by debbugs.gnu.org; 11 May 2015 05:38:53 +0000 Received: from localhost ([127.0.0.1]:40416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrgQX-000304-0k for submit@debbugs.gnu.org; Mon, 11 May 2015 01:38:53 -0400 Received: from [193.150.121.27] (port=42564 helo=mail01.sigterm.no) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YrgQU-0002zt-2K for 20095@debbugs.gnu.org; Mon, 11 May 2015 01:38:50 -0400 Received: by mail01.sigterm.no (Postfix, from userid 1006) id 5F1602E3414; Mon, 11 May 2015 07:38:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail01.nordcloud.no X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_PAST_03_06 autolearn=no autolearn_force=no version=3.4.0 Received: from smtp.postman.i2p (i2p-outproxy01.privacysolutions.no [193.150.121.66]) by mail01.sigterm.no (Postfix) with ESMTP id C0E382E3417 for <20095@debbugs.gnu.org>; Mon, 11 May 2015 07:38:46 +0200 (CEST) X-Virus-Scanned: clamav-milter 0.97 on milter.postman.i2p X-Mailer: smtp.postman.i2p - Official I2P Mailer From: Erik Popp MIME-Version: 1.0 To: 20095@debbugs.gnu.org Subject: Thanks for clarifying Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-Id: <20150511005439.ECA42AE418@smtp.postman.i2p> Date: Mon, 11 May 2015 00:54:39 +0000 (UTC) X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Thanks for clarifying. It turns out that the bug was in the tutorial I read, not sed. [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 20095 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: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Thanks for clarifying. It turns out that the bug was in the tutorial I read, not sed. [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Thanks for clarifying. It turns out that the bug was in the tutorial I read, not sed. From unknown Wed Jun 18 23:14:23 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, 08 Jun 2015 11:24:06 +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