9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "rob pike" <rob@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Sam questions
Date: Sat, 19 Aug 2000 11:16:11 -0400	[thread overview]
Message-ID: <200008191516.LAA29845@cse.psu.edu> (raw)

0,$x/old\.com/c/new.com/
1,$x/old\.com/c/new.com/
,x/old\.com/c/new.com/

All mean the same thing.  0 is the null string at the beginning
of the file.  1 is the first line, which of course starts at the null
string at the beginning of the file.  Old ed users still think the file
starts at line 1, but it really starts at 0.  The final example uses
sam's defaults to type less: the address , defaults left side to 0
and right side to $.  Other examples are ., to go from here to
the end, ,. to go from the beginning to here, etc.

Speaking of defaults, don't leave a space after the x because
that invokes another default:
	,x/asdf/
breaks the file into asdfs but
	,x /asdf/
is a shorthand for
	,x/.*\n/ /asdf
which isn't what you probably mean.  That does make it easy to
find lines that match a pattern though:
	,x g/pattern
(defaulting the trailing / and the command p).

-rob



             reply	other threads:[~2000-08-19 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-19 15:16 rob pike [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-08-19 13:14 Sape Mullender
2000-08-19 12:44 Matthias Teege
2000-08-19 13:03 ` Boyd Roberts

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=200008191516.LAA29845@cse.psu.edu \
    --to=rob@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /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).