From: Eckard Brauer <eckard.brauer@gmx.de>
To: 9front@9front.org
Subject: Re: [9front] bug in sed
Date: Fri, 11 Jan 2019 16:19:44 +0100 [thread overview]
Message-ID: <20190111161944.591b074a@gmx.de> (raw)
In-Reply-To: <0CABEB5C-713C-4FCB-8549-09465977DE96@stanleylieber.com>
Maybe it should simply be explained better in the man page.
man sam states:
s/regexp/text/
Substitute text for the first match to the regular expression in the
range. Set dot to the modified range. In text the character & stands
for the string that matched the expression. Backslash behaves as usual
unless followed by a digit: \d stands for the string that matched the
subexpression begun by the d-th left parenthesis. If s is followed
immediately by a number n, as in s2/x/y/, the n-th match in the range is
substituted. If the command is followed by a g, as in s/x/y/g, all
matches in the range are substituted.
where the 1st 2 sentences would lead me to the opinion that a possibly
following s, as it is when specifying g at end, starts at the already
modified line. So the original problem would be a bug in sam. But a
different interpretation is of course possible.
E.
Am Fri, 11 Jan 2019 10:01:20 -0500
schrieb Stanley Lieber <sl@stanleylieber.com>:
> On Jan 11, 2019, at 7:39 AM, hiro <23hiro@gmail.com> wrote:
> [...]
>
> isn’t the difference because sed operates line by line, while sam
> operates on the dot?
>
> if i understand correctly, you need ,s instead of s at the beginning
> of the sam command to apply the transform across the entire input.
>
> can’t test now.
>
> sl
>
>
--
:)
next prev parent reply other threads:[~2019-01-11 15:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 5:07 Sean Hinchee
2019-01-11 8:42 ` 有澤健治
2019-01-11 10:20 ` hiro
2019-01-11 10:22 ` hiro
2019-01-11 10:28 ` hiro
2019-01-11 10:35 ` hiro
2019-01-11 13:04 ` 有澤健治
2019-01-11 10:32 ` 有澤健治
2019-01-11 17:49 ` Sean Hinchee
2019-01-11 19:03 ` hiro
2019-01-11 10:55 ` Ethan Gardener
2019-01-11 11:19 ` hiro
2019-01-11 11:21 ` hiro
2019-01-11 12:39 ` hiro
2019-01-11 13:10 ` Nick Owens
2019-01-11 15:01 ` Stanley Lieber
2019-01-11 15:19 ` Eckard Brauer [this message]
2019-01-11 18:30 ` Ethan Gardener
2019-01-11 19:01 ` hiro
2019-01-11 21:11 ` Xiao-Yong Jin
2019-01-11 23:06 umbraticus
2019-01-11 23:29 ` hiro
2019-01-11 23:46 umbraticus
2019-01-11 23:45 ` Kurt H Maier
2019-01-11 23:52 ` Eckard Brauer
2019-01-11 23:49 umbraticus
2019-01-12 0:52 umbraticus
2019-01-12 0:58 ` Kurt H Maier
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=20190111161944.591b074a@gmx.de \
--to=eckard.brauer@gmx.de \
--cc=9front@9front.org \
/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).