9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Alex Musolino <alex@musolino.id.au>
To: 9fans@9fans.net
Subject: Re: [9fans] ed regular expressions in sam
Date: Tue, 20 Jul 2021 20:02:40 +0930	[thread overview]
Message-ID: <756D70D20260D724D55A0521A4A6F420@musolino.id.au> (raw)
In-Reply-To: <16267762600.13bFF.2473@composer.9fans.topicbox.com>

> In ed it is trivial to edit either side of a line such as changing
> the line,
> 
> I use sam and ed
> 
> to,
> 
> echo "I use sam and ed."
> 
> simply with,
> 
> g/.*/s//echo "&."/
> 
> I am trying to figure out how to do the same in sam. 

,s/^.*$/echo "&."/g

or, perhaps closer to your ed example:

,x/^.*$/s//echo "&."/


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Te7fcdc06a68bb777-Me4b54fadfcca529e4c53804e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

  reply	other threads:[~2021-07-20 10:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 10:17 revcomninos
2021-07-20 10:32 ` Alex Musolino [this message]
2021-07-20 11:00   ` revcomninos
2021-07-20 11:12     ` umbraticus
2021-07-20 13:06       ` Rob Pike
2021-07-20 13:45       ` revcomninos
2021-07-20 14:21         ` revcomninos
2021-07-20 14:31           ` Silas
2021-07-20 15:45             ` revcomninos
2021-07-20 18:32               ` Silas McCroskey
2021-07-20 18:57                 ` revcomninos

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=756D70D20260D724D55A0521A4A6F420@musolino.id.au \
    --to=alex@musolino.id.au \
    --cc=9fans@9fans.net \
    /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).