public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user]  Re: [OT] Use of sed
Date: Wed, 24 Jun 2009 14:55:06 +0000 (UTC)	[thread overview]
Message-ID: <h1teoa$k62$3@ger.gmane.org> (raw)
In-Reply-To: 200906241518.02546.peter@humphrey.ukfsn.org

On 2009-06-24, Peter Humphrey <peter@humphrey.ukfsn.org> wrote:
> On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote:
>
>> man sed answers your second question :)
>
>  s/regexp/replacement/
>      Attempt to match regexp against the pattern space. If successful,
>      replace that portion matched with replacement. The replacement may
>      contain the special character & to refer to that portion of the pattern
>      space which matched, and the special escapes \1 through \9 to refer to
>      the corresponding matching sub-expressions in the regexp.
>
> No mention of using a different separator, and I couldn't find
> any other reference either. I did look before asking.

Apparently that's something that everybody "just knows" so it
doesn't need to go in the man page. :)

It is, however, in the 'info' page:

   The s' Command
   ===============
   
      The syntax of the s' (as in substitute) command is
   s/REGEXP/REPLACEMENT/FLAGS'.  The /' characters may be
   uniformly replaced by any other single character within any
   given s' command. The /' character (or whatever other character
   is used in its stead) can appear in the REGEXP or REPLACEMENT
   only if it is preceded by a \' character.
   

-- 
Grant Edwards                   grante             Yow! BARBARA STANWYCK makes
                                  at               me nervous!!
                               visi.com            




      parent reply	other threads:[~2009-06-24 15:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 23:48 [gentoo-user] [OT] Use of sed Peter Humphrey
2009-06-23 23:59 ` Roy Wright
2009-06-24  1:36 ` Neil Bothwick
2009-06-24  8:52   ` Arttu V.
2009-06-24  9:34   ` Peter Humphrey
2009-06-24  9:56     ` Alan McKinnon
2009-06-24 11:03       ` Peter Humphrey
2009-06-24 11:19         ` Neil Bothwick
2009-06-24 11:28 ` Alex Schuster
2009-06-24 14:18   ` Peter Humphrey
2009-06-24 14:44     ` Alex Schuster
2009-06-24 14:49     ` Renat Golubchyk
2009-06-24 15:00       ` Paul Hartman
2009-06-24 14:55     ` Grant Edwards [this message]

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='h1teoa$k62$3@ger.gmane.org' \
    --to=grant.b.edwards@gmail.com \
    --cc=gentoo-user@lists.gentoo.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