9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Sam questions
@ 2000-08-19 12:44 Matthias Teege
  2000-08-19 13:03 ` Boyd Roberts
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Teege @ 2000-08-19 12:44 UTC (permalink / raw)
  To: 9fans

Moin,

I want to replace an domainname with another one and try: 

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

It didn't work and I dont know where the problem is.

The second questions is: How do I search for an text, move
the point there and scroll the file to the aktual
position? Searching is not the major problem but how I
make the correct placement. 

Many thanks
Matthias


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Sam questions
  2000-08-19 12:44 [9fans] Sam questions Matthias Teege
@ 2000-08-19 13:03 ` Boyd Roberts
  0 siblings, 0 replies; 4+ messages in thread
From: Boyd Roberts @ 2000-08-19 13:03 UTC (permalink / raw)
  To: Matthias Teege, 9fans

> I want to replace an domainname with another one and try: 
> 
> 0,$ x/old\.com/c/new\.com/

,x/old\.com/c/new.com/

but that changes all instances of old.com.

> The second questions is: How do I search for an text, move
> the point there and scroll the file to the aktual
> position? Searching is not the major problem but how I
> make the correct placement. 

command window:

/text

the scrolling happens for free -- as it should.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Sam questions
@ 2000-08-19 15:16 rob pike
  0 siblings, 0 replies; 4+ messages in thread
From: rob pike @ 2000-08-19 15:16 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Sam questions
@ 2000-08-19 13:14 Sape Mullender
  0 siblings, 0 replies; 4+ messages in thread
From: Sape Mullender @ 2000-08-19 13:14 UTC (permalink / raw)
  To: 9fans

You probably want to say
1,$x/old\.com/c/new.com/

	Sape


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-19 15:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-19 12:44 [9fans] Sam questions Matthias Teege
2000-08-19 13:03 ` Boyd Roberts
2000-08-19 13:14 Sape Mullender
2000-08-19 15:16 rob pike

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).