9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ieliedonge@wilsonb.com
To: 9front@9front.org
Cc: k0ga@shike2.com
Subject: Re: [9front] sed: fix moving '^' match
Date: Sun, 27 Aug 2023 08:23:11 +0900	[thread overview]
Message-ID: <3OWTA7C36ZVYA.3C6IMNK32OWEU@wilsonb.com> (raw)
In-Reply-To: <CAFSF3XP-CZJP5cFac8o_+g_VVdiMJynqp=GVwc+NHvMVxUKMXQ@mail.gmail.com>

> i disagree, i can interprete sed(1) to allow exactly this feature

You are way more creative than most then. I tend to think that lines only have
a single beginning and that `echo "blah"` writes a single line.

From regexp(6):

    A ^ matches the beginning of a line; $ matches the end of the line.

From sed(1):

    g     Global. Substitute for all non–overlapping instances of the regular expression rather than just the first one.


FWIW, the current 9front behavior is also inconsistent with Unix V7's sed,
which both BSD and GNU implementations are, perhaps ironically, actually more
consistent than us in this particular case:

    $ echo aabbccd | sed 's/^..//g'
    bbccd

  parent reply	other threads:[~2023-08-26 23:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 21:46 ori
2023-08-26  0:04 ` [9front] " Anthony Martin
2023-08-26  9:14   ` hiro
2023-08-26 17:58     ` ori
2023-08-26 18:02     ` ori
2023-08-26  9:05 ` [9front] " hiro
2023-08-26  9:41   ` ieliedonge
2023-08-26 16:48     ` hiro
2023-08-26 18:00       ` ori
2023-08-26 23:23       ` ieliedonge [this message]
2023-08-27  8:33         ` hiro
2023-08-27  9:54           ` tlaronde
2023-08-27 11:19             ` ieliedonge
2023-09-23  1:35             ` ieliedonge
2023-09-23 10:30               ` hiro
2023-09-24 15:35               ` ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3OWTA7C36ZVYA.3C6IMNK32OWEU@wilsonb.com \
    --to=ieliedonge@wilsonb.com \
    --cc=9front@9front.org \
    --cc=k0ga@shike2.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).