From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200008191516.LAA29845@cse.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] Sam questions From: "rob pike" Date: Sat, 19 Aug 2000 11:16:11 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: fd936b8c-eac8-11e9-9e20-41e7f4b1d025 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