From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 2 Aug 2012 10:45:32 +0200 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] sam, shorten dot by 1 line Topicbox-Message-UUID: a6c74120-ead7-11e9-9d60-3106f5b1d025 On 2 August 2012 00:21, Rob Pike wrote: > .,.+0 means: from the beginning of . to the end of .+0, and .+0 is the > null string at the end of . It just does not work for me like that. (.+#0 seems to do what you describe.) 1) Having a line asdfasdf asdfasdf asdfasdf | asdfasdfa asfdsfasdfa where | represents the current (emty) dot, .+0 selects everything to the right from the original dot to the end of the line, including the newline. 2) Having | asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf .+0 does nothing 3) Having asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf | .+0 selects the newline, and next .+0 selects the empty dot on the beginning of the next line, like what we start from in the case 2). This behaviour, along with the mentioned behaviour of +-, where for | asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf +- selects the previous line while for asdfasdf asdfasdf asdfasdf | asdfasdfa asfdsfasdfa it selects the current line still stays ununderstood by me... (and the last example is contraintuitive). [sideremark: -+ works even when the empty dot is on the first and last line of the file, the latter being a problem for +-, which is a strange asymmetry. How should one then select the line on which a possibly multiline dot ends and at the same time this is the last line in the file (which however, you do not have to know if this happens under some loop command)?] Any more explanation is highly welcome! Ruda