Assaf Gordon <assafgordon@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Assaf Gordon <assafgordon@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 22427) by debbugs.gnu.org; 7 Feb 2016 06:23:18 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 07 01:23:18 2016 Received: from localhost ([127.0.0.1]:36362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aSIkg-00038N-7I for submit <at> debbugs.gnu.org; Sun, 07 Feb 2016 01:23:18 -0500 Received: from mail-oi0-f47.google.com ([209.85.218.47]:34689) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <meyering@HIDDEN>) id 1aSIke-000388-BZ for 22427 <at> debbugs.gnu.org; Sun, 07 Feb 2016 01:23:16 -0500 Received: by mail-oi0-f47.google.com with SMTP id w5so64457868oie.1 for <22427 <at> debbugs.gnu.org>; Sat, 06 Feb 2016 22:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=05Rt+ljIi1v2/ms37XO6BYZvgZU7VfDFpsron/bAG7o=; b=jtjR/ppFydSkLGk0DEC1c2+iQyGlybZJHvJgp9kWvKYfHUB7kGjvm4CSnH4DL5yfbz /XuUkyZEte3T946OoPbAGk6ejMNtOp3aJtaVJCHtciVEymaqVXrE+qYpq/0mikSUMOov y7xw8bHoP7iLjclRl7fAx87SKoQwqF8nP0vOk4wqtmWwUDgtvF6aWF9RAcu7Fjiimz2d YBhanHYMYa+gJw4tOERUuIDEUatKsCXvU4pUlU86SPEzKH2lcDt33xKjhMiFMcmYYPby oAolRINM4tssprIWAwGYZPZ5tOcuH8lT58q6b5I5hkgNnzbzAlEF3ZaKs+jmwollP12G UbHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=05Rt+ljIi1v2/ms37XO6BYZvgZU7VfDFpsron/bAG7o=; b=XgzHNK0Tx5TJ4mleNs98yyhilbfcszHlIDsXus9n+rvTy8t99ALqokaLO+GaH4Q5mE tsc5JudpnXD/8ITVSNpTR19Bdo8TFuTfEp9m5wY/2AOV3nNYC+QOo9srXPtPKO/RZETw 6oM9PNkHeurv/AfMZCsUDjdJQBCTqrr+EfEJeiyQ4E8uaPG15F8XjU9tyOfOO0/gemSS oNGdWkg1GtvoCQqp9/XK0Gbt8SZddhIhZGl0SKLCzBqwE6cGjh5OaOCUWIhpMfD73j/f kKOD4Wjh0AwDLXamzoeqnZaS2XL7QxiVUSZR9xHAcuYk0JRqTkh2v8tmkC7gr591hYus euTg== X-Gm-Message-State: AG10YOTEuKJX5WY0YJqznym2HFC4IkTtu1c9gwK2b4U0sUZ+mAU+yogROictADVAyudgFJ1inl666Vvxx/pfyA== X-Received: by 10.202.191.7 with SMTP id p7mr14693583oif.64.1454826190875; Sat, 06 Feb 2016 22:23:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.64.134 with HTTP; Sat, 6 Feb 2016 22:22:51 -0800 (PST) In-Reply-To: <CA+8g5KFm+GZkxgUAGEzzHGUx9xW5ZiYz7eQ-S+BoTwaaJ_MYMQ@HIDDEN> References: <20160121103800.GA32572@HIDDEN> <CAOS_Y6RY_aREsZ3aOHr5rTA1uS5JVsEUvLHpbLA-Uu+_UdMvvA@HIDDEN> <56A13944.20602@HIDDEN> <CA+8g5KFm+GZkxgUAGEzzHGUx9xW5ZiYz7eQ-S+BoTwaaJ_MYMQ@HIDDEN> From: Jim Meyering <jim@HIDDEN> Date: Sat, 6 Feb 2016 22:22:51 -0800 X-Google-Sender-Auth: lObNp8LPqwx50SAxu3Hvh8RQTz4 Message-ID: <CA+8g5KEiuK03XHPhdPB5hBVQsZ7_FWPXyO+_uh3E16o=qADZ1w@HIDDEN> Subject: Re: bug#22427: Odd behaviour of sed with n/N and line ranges To: Eric Blake <eblake@HIDDEN> Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22427 Cc: 22427 <at> debbugs.gnu.org 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.7 (/) On Fri, Jan 22, 2016 at 4:45 AM, Jim Meyering <jim@HIDDEN> wrote: > On Fri, Jan 22, 2016 at 4:02 AM, Eric Blake <eblake@HIDDEN> wrote: >> This message came up on the POSIX list today, claiming GNU sed has a bug: >> >> On 01/21/2016 12:02 PM, Rob Landley wrote: >>> On Thu, Jan 21, 2016 at 4:38 AM, Geoff Clare <gwc@HIDDEN> wrote: >>>> I'm seeing this with versions of sed derived from System V: >>>> >>>> $ printf '%s\n' a b | sed -e n -e '2s/b/c/' >>>> a >>>> c >>>> $ printf '%s\n' a b | sed -e n -e '1,2s/b/c/' >>>> a >>>> b >>> >>> Having recently implemented toybox sed from the posix spec, that's >>> what my implementation is producing too. >>> >>> You have to match the first line of a range in order to activate the >>> range (numeric works same as /ascii/ that way). Since the above skips >>> past the first line, you never activate the range, so later lines >>> don't trigger the range contents either, >>> >>> The gnu behavior is wrong. Replace the 1 with /a/ and the logic may be >>> easier to follow >>> >>> (But hey, at least the gnu guys finally fixed "sed p - -" segfaulting >>> when it freed stdin the second time...) > > Thanks to both of you. > I'll certainly take a look before the upcoming release. I'm not convinced that this should be changed. First, the vendor sed from Solaris 5.10 works the same way GNU sed does, and so does the one from busybox-1.22.1. Second, and perhaps more importantly, it feels like claiming the 1,2 range fails to match line 2 because the beginning address, "1", never matched a line (that was skipped due to the "n") is failing on a technicality. I think of the M,N (M<N) line number address range as matching any line in [M..N], regardless of whether line M happens to be processed. I feel that an address spec like 1,9 is conceptually different from one that specifies /a/,9. The latter specifies a dynamic condition: testing whether /a/ matches each pattern space, while the former specifies a static condition: a range of line numbers, that is independent of whether line "1" never sees the substitution command, due to thae initial "n" command.
bug-sed@HIDDEN
:bug#22427
; Package sed
.
Full text available.Received: (at 22427) by debbugs.gnu.org; 22 Jan 2016 12:46:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 22 07:46:13 2016 Received: from localhost ([127.0.0.1]:57098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aMb6T-0008Cb-4G for submit <at> debbugs.gnu.org; Fri, 22 Jan 2016 07:46:13 -0500 Received: from mail-io0-f174.google.com ([209.85.223.174]:33067) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <meyering@HIDDEN>) id 1aMb6Q-0008CN-5B for 22427 <at> debbugs.gnu.org; Fri, 22 Jan 2016 07:46:10 -0500 Received: by mail-io0-f174.google.com with SMTP id q21so86937543iod.0 for <22427 <at> debbugs.gnu.org>; Fri, 22 Jan 2016 04:46:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=cel+ftoHeKvi2/de2HASwvsxt104Vyf7mjFD1gWBJzY=; b=VXemK6RMScgoFbs7fPM1YeWaWrwwh2lfdvgUh8G0KtMGN9+2GOGvLkHXPsFOuwM/Lz dkh5qp+YS4B2B/IpFDX+xJDEk05C1EwvBWRRlCoGbUOl9e8MMTL8NnxXtgZPkDV3LmSd vcdBeYLmjCv1ge5tcTIWgv8YHEC8XnimWBeFMqYYuWEhQqIR06IRtuRhd1YZl5XIZvUi iiSLR3PEONwGt+/aJ+zJDUqxH5Ntm/wB9gMCI9/H+tTBuxEuD/rBfJV8oWLhg6L/PwDB pFGjCw/InEc15IGr+jZNaDV04ZttBf8fkTnxpAbMPfOGd0l19D2MDDrGNEew72QjdUHG E8tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=cel+ftoHeKvi2/de2HASwvsxt104Vyf7mjFD1gWBJzY=; b=jgD54R/5xeiSF6gDmGSR8oPpvusQdirrk/CcG4afmQrDejetVeWfbmcxMae5QxHhAN kGR3TqkP9OvTyEcM+tdR8FU2QUVsM1prQyXEohrPXEvyF98pYU9Iad4kNsiPgWXtdAE/ 3C2WXgrT3qcaZ+ecXJFB0rNrmKm4yxUcRo9Fpfpx1sCszZuWphVaGG7RDa0gMvBDBDYv SlpDakXLNbVbs+qOgzjZEFFl+gdw9v/FO1yfsuFgM0yA8DjRXC8Nwpm3+5D8A6sWKl3j VioTLigrrHkJC6yirF3syTMqikkVoj/KmUPGFBzULnrwJPXIHv+CAsir8MxYjut4nryZ VRsA== X-Gm-Message-State: AG10YOSWvygpQmgf2DAGMTm0xGpRYDBLBdY5rUzLpH2YhanrWpvV6l07rjv3i0k4/0rmsba85AqMZm64HbCNWg== X-Received: by 10.107.138.15 with SMTP id m15mr3551688iod.40.1453466764527; Fri, 22 Jan 2016 04:46:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.10.145 with HTTP; Fri, 22 Jan 2016 04:45:44 -0800 (PST) In-Reply-To: <56A13944.20602@HIDDEN> References: <20160121103800.GA32572@HIDDEN> <CAOS_Y6RY_aREsZ3aOHr5rTA1uS5JVsEUvLHpbLA-Uu+_UdMvvA@HIDDEN> <56A13944.20602@HIDDEN> From: Jim Meyering <jim@HIDDEN> Date: Fri, 22 Jan 2016 20:45:44 +0800 X-Google-Sender-Auth: bm6xcUOn9_gsKQ9S4xb8oIt-tKA Message-ID: <CA+8g5KFm+GZkxgUAGEzzHGUx9xW5ZiYz7eQ-S+BoTwaaJ_MYMQ@HIDDEN> Subject: Re: bug#22427: Odd behaviour of sed with n/N and line ranges To: Eric Blake <eblake@HIDDEN> Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 22427 Cc: 22427 <at> debbugs.gnu.org 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.4 (/) On Fri, Jan 22, 2016 at 4:02 AM, Eric Blake <eblake@HIDDEN> wrote: > This message came up on the POSIX list today, claiming GNU sed has a bug: > > On 01/21/2016 12:02 PM, Rob Landley wrote: >> On Thu, Jan 21, 2016 at 4:38 AM, Geoff Clare <gwc@HIDDEN> wrote: >>> I'm seeing this with versions of sed derived from System V: >>> >>> $ printf '%s\n' a b | sed -e n -e '2s/b/c/' >>> a >>> c >>> $ printf '%s\n' a b | sed -e n -e '1,2s/b/c/' >>> a >>> b >> >> Having recently implemented toybox sed from the posix spec, that's >> what my implementation is producing too. >> >> You have to match the first line of a range in order to activate the >> range (numeric works same as /ascii/ that way). Since the above skips >> past the first line, you never activate the range, so later lines >> don't trigger the range contents either, >> >> The gnu behavior is wrong. Replace the 1 with /a/ and the logic may be >> easier to follow >> >> (But hey, at least the gnu guys finally fixed "sed p - -" segfaulting >> when it freed stdin the second time...) Thanks to both of you. I'll certainly take a look before the upcoming release.
bug-sed@HIDDEN
:bug#22427
; Package sed
.
Full text available.Received: (at submit) by debbugs.gnu.org; 21 Jan 2016 20:02:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 21 15:02:30 2016 Received: from localhost ([127.0.0.1]:56713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aMLR8-0007rS-Kf for submit <at> debbugs.gnu.org; Thu, 21 Jan 2016 15:02:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49832) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <eblake@HIDDEN>) id 1aMLR6-0007rA-An for submit <at> debbugs.gnu.org; Thu, 21 Jan 2016 15:02:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eblake@HIDDEN>) id 1aMLQw-0000CC-6f for submit <at> debbugs.gnu.org; Thu, 21 Jan 2016 15:02:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eblake@HIDDEN>) id 1aMLQw-0000C8-3W for submit <at> debbugs.gnu.org; Thu, 21 Jan 2016 15:02:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <eblake@HIDDEN>) id 1aMLQv-0000xi-3K for bug-sed@HIDDEN; Thu, 21 Jan 2016 15:02:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eblake@HIDDEN>) id 1aMLQr-0000BE-TW for bug-sed@HIDDEN; Thu, 21 Jan 2016 15:02:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eblake@HIDDEN>) id 1aMLQr-0000B8-NO for bug-sed@HIDDEN; Thu, 21 Jan 2016 15:02:13 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2A11C8F271 for <bug-sed@HIDDEN>; Thu, 21 Jan 2016 20:02:13 +0000 (UTC) Received: from [10.3.113.211] (ovpn-113-211.phx2.redhat.com [10.3.113.211]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0LK2Cti020684 for <bug-sed@HIDDEN>; Thu, 21 Jan 2016 15:02:12 -0500 Subject: Re: Odd behaviour of sed with n/N and line ranges To: bug-sed@HIDDEN References: <20160121103800.GA32572@HIDDEN> <CAOS_Y6RY_aREsZ3aOHr5rTA1uS5JVsEUvLHpbLA-Uu+_UdMvvA@HIDDEN> From: Eric Blake <eblake@HIDDEN> Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56A13944.20602@HIDDEN> Date: Thu, 21 Jan 2016 13:02:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <CAOS_Y6RY_aREsZ3aOHr5rTA1uS5JVsEUvLHpbLA-Uu+_UdMvvA@HIDDEN> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tiETRK0e0sJ6IEJ9otnTJPVnaUxN7bbTu" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit 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: -4.1 (----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tiETRK0e0sJ6IEJ9otnTJPVnaUxN7bbTu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This message came up on the POSIX list today, claiming GNU sed has a bug:= On 01/21/2016 12:02 PM, Rob Landley wrote: > On Thu, Jan 21, 2016 at 4:38 AM, Geoff Clare <gwc@HIDDEN> wrote:= >> I'm seeing this with versions of sed derived from System V: >> >> $ printf '%s\n' a b | sed -e n -e '2s/b/c/' >> a >> c >> $ printf '%s\n' a b | sed -e n -e '1,2s/b/c/' >> a >> b >=20 > Having recently implemented toybox sed from the posix spec, that's > what my implementation is producing too. >=20 > You have to match the first line of a range in order to activate the > range (numeric works same as /ascii/ that way). Since the above skips > past the first line, you never activate the range, so later lines > don't trigger the range contents either, >=20 > The gnu behavior is wrong. Replace the 1 with /a/ and the logic may be > easier to follow >=20 > (But hey, at least the gnu guys finally fixed "sed p - -" segfaulting > when it freed stdin the second time...) >=20 > Rob >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tiETRK0e0sJ6IEJ9otnTJPVnaUxN7bbTu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWoTlEAAoJEKeha0olJ0NqMtAIAK+PsC69DFesh3DSdyfP9G8c AL6bGUYKstTccD24EN5SBlM2sTWvfOYewSzEuO5+EATUc4BUTRgbUNV73InvguW/ 1e5g8Eu/txZm/cuWi2RWI7ojhQ1O019RYXFQC0UgN86b+Z40oYrkFqojROevVovm EHvBlDANYbJr1pMtjI6jT3Y77wUKm7LIr82aBhhNCkKeGTwCVfRGyLeBWXRQDBjH 31XD8j0Fr+1hucGouZsYfjXOVfX+tgXHYhXLoX+GRYOPzj9UjaBzyf3XHBCUxYRK XZcJu+53Lh0dLdCguskjZGOY4GNubPa4IkO25NZSeTMAr16Gv1MhCtGkWWV8sqQ= =O+37 -----END PGP SIGNATURE----- --tiETRK0e0sJ6IEJ9otnTJPVnaUxN7bbTu--
Eric Blake <eblake@HIDDEN>
:bug-sed@HIDDEN
.
Full text available.bug-sed@HIDDEN
:bug#22427
; Package sed
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.