From unknown Fri Jun 20 07:12:07 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#36129 <36129@debbugs.gnu.org> To: bug#36129 <36129@debbugs.gnu.org> Subject: Status: Error in sed manual Reply-To: bug#36129 <36129@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:12:07 +0000 retitle 36129 Error in sed manual reassign 36129 sed submitter 36129 Gavin Rebeiro severity 36129 normal tag 36129 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 07 14:13:31 2019 Received: (at submit) by debbugs.gnu.org; 7 Jun 2019 18:13:31 +0000 Received: from localhost ([127.0.0.1]:52389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZJMp-0002ei-En for submit@debbugs.gnu.org; Fri, 07 Jun 2019 14:13:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:40043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZJK9-0002at-OB for submit@debbugs.gnu.org; Fri, 07 Jun 2019 14:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45477) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZJK8-0006ne-Ep for bug-sed@gnu.org; Fri, 07 Jun 2019 14:10:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZJK4-0004HQ-Ur for bug-sed@gnu.org; Fri, 07 Jun 2019 14:10:42 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:35129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZJK4-0003tz-Gm for bug-sed@gnu.org; Fri, 07 Jun 2019 14:10:40 -0400 Received: by mail-lf1-x12a.google.com with SMTP id a25so2311741lfg.2 for ; Fri, 07 Jun 2019 11:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gVDIq+EJvrAnXXZAUC/8X5FYzpCQfGLxiBjrxqM/xLE=; b=oq5nA1S0b8PfdkpUJ9WMigTjJeyz3entBN3mHbLwS4M4YahQro5msn6CRjLiKLMq9F E8SAgUvzT6km71QJAha7ONtSjHTxuqejvGvwdv57EMYMW79xUd3a927OwDsAtEOv+iX3 WXpKXYlyrZWUqPRCU39dL6XoPTkRoHwgrnMcfwcnHUr305ajP1QG/kQFvfrAROhFogYW 9KayxNaUDD8f9LqaCxU02HZBaviH4lJtFAk9x3KKj+JHzYxRLy4/hJ15Ii6rOuJFAMAs xVPqEP4e24A46ZebRF+ue6R9HaPka5B5tS/ZK/0otP9GRFQTQlcfYdFN5ebBQb6rqYog bo/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gVDIq+EJvrAnXXZAUC/8X5FYzpCQfGLxiBjrxqM/xLE=; b=L90ny4r9ZpGvNDKE650c7uStR0icKjEyj+eNIH+1PbnKcBhagtkd089/EdJ6QDHI/d hADLJ4FBnlohluOe/h3RpfNMXbbNGKFF7KvRIO/d4AZhgbiJ9a6/Uas8WZfGRKq7hs4X Q/V7h+e+NHQ9bMPfNdcreEnQKby87dKnjU+8HXWR4fzXklvlxRodvSHdIZ5bcUznlCSU D1hhDvjcKuQhSn9BVDFOu98c3EkWSUNbCor78d42mKxjJqfSA00IEZt5BMwrWTY4h4Um g3ZkiVVuISRtlPcmmoEC1gXgmS9qDz8M/1omAN+qkLJZXExjRxPOGKiY+OAhJD4TfM+A ISpg== X-Gm-Message-State: APjAAAXMkbg4tyEm7haAoLG0deYtVUlzfrrOlp606HDTliZeUmaLkSh0 2nUDsqjpYhu3t8dUwdT/uRgwoyZN9Wq5/4Cf3Q/1ZepI X-Google-Smtp-Source: APXvYqwV/nVGV6gyQoaXFbK4JMFk2xQCLextVDxComXMbY78i7/qzcelsw8E2btC3x6iUQPN8SVK2yC3I2reUTIXpt4= X-Received: by 2002:a19:4bc5:: with SMTP id y188mr27853058lfa.113.1559931023336; Fri, 07 Jun 2019 11:10:23 -0700 (PDT) MIME-Version: 1.0 From: Gavin Rebeiro Date: Fri, 7 Jun 2019 19:10:12 +0100 Message-ID: Subject: Error in sed manual To: bug-sed@gnu.org Content-Type: multipart/alternative; boundary="000000000000852b85058abfbebb" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::12a X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 07 Jun 2019 14:13:29 -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.1 (--) --000000000000852b85058abfbebb Content-Type: text/plain; charset="UTF-8" Hi, In section 3.3 (The s Command), we are told that both upper-case and lower-case `i' match provided regular expressions in a case-insensitive manner. However, in section 4.3 (selecting lines by text matching), we are told that lower-case `i' is reserved for the insert command. The lower-case `i' needs to be removed from section 3.3. Best wishes, Gavin Rebeiro --000000000000852b85058abfbebb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
In section 3.3 (The s Command), we are = told that both upper-case and lower-case `i' match provided regular exp= ressions in a case-insensitive manner. However, in section 4.3 (selecting l= ines by text matching), we are told that lower-case `i' is reserved for= the insert command.

The lower-case `i' needs = to be removed from section 3.3.

Best wishes,
=
Gavin Rebeiro
--000000000000852b85058abfbebb-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 07 21:51:01 2019 Received: (at 36129) by debbugs.gnu.org; 8 Jun 2019 01:51:01 +0000 Received: from localhost ([127.0.0.1]:52656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZQVZ-0000Ze-88 for submit@debbugs.gnu.org; Fri, 07 Jun 2019 21:51:01 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:46777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZQVX-0000ZO-D6; Fri, 07 Jun 2019 21:50:59 -0400 Received: by mail-pf1-f180.google.com with SMTP id 81so2109950pfy.13; Fri, 07 Jun 2019 18:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4pckoZE1FsVFEpto6p2lSIWRWi41oJpkqUaHAhzaElc=; b=TpH5wQ+fgkCh6CvRT6X+vxPpsZLxtpMICg/nI4l23nBtnh9tmsAHbnqhZCdQcjDMG2 whqK7toIDdj5W6oW5Y056WNhRzlslR0zIu7vKSea5/H7gA/H97UndufoERxxEqlcENK0 8zBlTeXlzG1+gd/BBqDqUdiuTRv8lJGShkKOakuVVNaLk2s97zKFeIi7A1uXgUIsLVFM CqGx39LMTE7VPH/PcK4870fdYUBH6QyAii0Lp8PFUNHoeXCLXoqHmrjEV6nAC08xcUpS skfptLzaYWFMxCV6McZvW8LVR+PRHtk1EQcAx8+Caej8ZY8y/BPwPDEK5n6KfQIsoWAW JD/A== 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4pckoZE1FsVFEpto6p2lSIWRWi41oJpkqUaHAhzaElc=; b=CY0+g+ZXVoj1FlvPdFHD7W8KH1zHgsfrhM8lI1G/8jIlsH6xLKgpY1D21eLFVgjzAG mM7/R0ffrC9Tq8d1fjhZE6b6XTil8wprUhgJx3W8pwiJXN23GEwOtIXeIpKX4ghUz/yg ca9Gi9OvZMw8gkfuxYpYY3GNHV3rZIc7lAJy6D5hgd62QXU4ISsbwHHd3inaMZv1GX5F DTdenj7zjDLaun33b9HqKyueYanX5duteLceBMWYy9hBOHIsuzz1tDj+HlGSJosYDAh3 Z8H9mxumuD3a92zuZ1NSjjlHd6JdT2gmMvcsfFJOoRPUYZELLI6qwfWcOsntDX2u1vbD KtXQ== X-Gm-Message-State: APjAAAXrbUxgj6xtfyJqynuBGcAkUVI1adJwEJgR3mHKprO8KeaOELcM VodY5pycTo+XauDmKMqwhMEaHZw2 X-Google-Smtp-Source: APXvYqy9wqgk+iQufQDoYU937Cp28V3yey53DwgUEiLUJhfDmQqO0yFXGgFMrxKNUBQuhdkgEe09qw== X-Received: by 2002:a17:90a:26e4:: with SMTP id m91mr8860692pje.93.1559958652913; Fri, 07 Jun 2019 18:50:52 -0700 (PDT) Received: from tomato (moose.housegordon.com. [184.68.105.38]) by smtp.gmail.com with ESMTPSA id d4sm3037813pju.19.2019.06.07.18.50.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 18:50:52 -0700 (PDT) Received: by tomato (Postfix, from userid 1000) id 244B0682A1E; Fri, 7 Jun 2019 19:50:51 -0600 (MDT) Date: Fri, 7 Jun 2019 19:50:51 -0600 From: Assaf Gordon To: Gavin Rebeiro Subject: Re: bug#36129: Error in sed manual Message-ID: <20190608015051.GG18519@tomato.moose.housegordon.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36129 Cc: 36129@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: -1.0 (-) tag 36094 notabug close 36094 stop Hello, On Fri, Jun 07, 2019 at 07:10:12PM +0100, Gavin Rebeiro wrote: > In section 3.3 (The s Command), we are told that both upper-case and > lower-case `i' match provided regular expressions in a case-insensitive > manner. However, in section 4.3 (selecting lines by text matching), we are > told that lower-case `i' is reserved for the insert command. > > The lower-case `i' needs to be removed from section 3.3. This is conflating three different uses of "i". Section 3.3 refers to flags to the 's' command, i.e. the letters appearing after the third slash (like "g"): s/foo/bar/i s/foo/bar/I s/foo/bar/ig In this case, both "i" and "I" affect the behaviour of the s/// command, allowing case-insensitive regex match for the substitution (that is, "foo" and "FOO" and "FoO" etc. will match and will be substituted with "bar"). Section 4.3 refers to flags to regular-expression addresses - a way to select input lines based on content, before executing any command on them. Here, only upper-case "I" makes the match case-insensitive: /foo/d /foo/Id In the first example, lines containing lower-case 'foo' will be deleted (due to regex matching, followed by the 'd' command). In the second example, the upper-case 'I' tells sed to match case-insensitively, meaning lines with "FOO" and "FoO" will also be deleted. Because there is no "I" command, sed knows the "I" is part of the address regex specification. The comment in the manual says this: "In many other programming languages, a lower case i is used for case-insensitive regular expression matching. However, in sed the i is used for the insert command (see insert command)." And what it means is that if we wrote the following command: /foo/id sed will actaully interpret it as: 1. /foo/ - match lines with "foo" 2. "i" - the insert command (i.e. insert text before the matching line) 3. "d" - the text to insert. Result: $ printf "%s\n" foo bar | sed '/foo/id' d foo bar Therefore to allow case-insensitive address-matches, sed has to choose a letter that isn't used for other commands - hence upper-case "I". Hope this explains the issue. I'm closing it as "not a bug", but discussion can continue by replying to this thread. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 04:39:33 2019 Received: (at control) by debbugs.gnu.org; 29 Jun 2019 08:39:33 +0000 Received: from localhost ([127.0.0.1]:43419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh8tR-0002mk-7s for submit@debbugs.gnu.org; Sat, 29 Jun 2019 04:39:33 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:42513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh8tO-0002mW-Ps for control@debbugs.gnu.org; Sat, 29 Jun 2019 04:39:31 -0400 Received: by mail-pf1-f169.google.com with SMTP id q10so4131485pff.9 for ; Sat, 29 Jun 2019 01:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=Q57wY8mvzXc5Em2SgyiemF+IPgiXuEQdEJxGsSnQYYg=; b=jXnyqc4naygYUN2PwQ1mwQl6IdOVPCU32BAB/SMUZO0ygqBRANprx+HthGzaIOJcrg G75tu8D6IB6ZuiuDHC+x5qY91+z8lcf2U0Bg8Hwg9rEQ0CdY90v+sU3WOhdb3tDJHnfY 3IwGYj9htOpWqA6yhO2GNcuBkvTJfCNug06EjnIBGBEdd2YaPIXbf+ZObqMclOXmEP4m HctiATd4RQ7lqelBKafr1aijjVsqxdJgGevRPkgu4bp9p973ILufLYGXj7MBT6pb+8yg ma47rU3T0KtbXgKow6FJjiLVai1RVuEV6I9vUl5Pvenn7rWBJkatUQxhLgSyr1+e8NRU aOUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Q57wY8mvzXc5Em2SgyiemF+IPgiXuEQdEJxGsSnQYYg=; b=dWXquK+26CxDlKvhqFcx6KvBRSE9bO4bEOgXHguSY+kM7iZ/u60UzNfMy0O9S4Fz5y 9/J3Fc7mCqoYCI2uz739EHS6HXZGb6wC1vRBpETfdFdHyYYvsn/YHm4nymbfwjoYsdAQ eDtDZHhP0HkvHMCRFZmd+y3zkFf8mgcY2AO/mfiHM4XK1vS6zOla7CiDjx3N+LQORM7f IsYMpDPuS2dGzrlWtQc+wJ7gwOqiq3d32BBpPLgK4lLgJp8rEMQIQgkt1SKsXPGB6tIT QzwrA1r0tTiX0EcMPFkvdDlDyG1pUyR+m8sheNN1j7X/cDxX6sTMpkWal81mdj+h4pmA irdg== X-Gm-Message-State: APjAAAVHk2dSTyU21fDeVnsVS8MrZ7r6Y4RsuCmTPh22iYaxG0ouOPHQ ndQBWL2e5STquum6xua7KlvRvRzv X-Google-Smtp-Source: APXvYqy9SN7Ej+Ps/i92gLKcZzkAF6fhCpRIaK6MyRFrgjzESWlUhP7pwvZHD1hH6aZLydIwnuM8mg== X-Received: by 2002:a63:6ecf:: with SMTP id j198mr13424483pgc.437.1561797564577; Sat, 29 Jun 2019 01:39:24 -0700 (PDT) Received: from tomato.moose.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id c8sm1240084pjq.2.2019.06.29.01.39.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jun 2019 01:39:23 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <403d142d-ebc6-efcf-e24c-c5e2fed0d803@gmail.com> Date: Sat, 29 Jun 2019 02:39:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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: tag 36129 notabug close 36129 Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.210.169 listed in list.dnswl.org] 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 (+) tag 36129 notabug close 36129 From unknown Fri Jun 20 07:12:07 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, 27 Jul 2019 11:24:07 +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