From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Rob Pike Date: Wed, 1 Aug 2012 15:21:11 -0700 Message-ID: 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: a6bcce34-ead7-11e9-9d60-3106f5b1d025 Break it down: a,b means: from the beginning of a to the end of b .,. means: from the beginning of . to the end of . 1 means: from the beginning of line 1 to the end of line 1. .,.+0 means: from the beginning of . to the end of .+0, and .+0 is the null string at the end of . Now the step: .,.+0-1 means: from the beginning of . to the end of .+0-1, which means the end of the line preceding the null string at the end of ., which ends right back at .+0, so it means the last line of ., so this doesn't work. .,.+0-2 means: from the beginning of . to the end of .+0-2, which means the end of the second line preceding .+0, which is one line back from the end. QED. The key observation is that on the right of the comma you're talking about where the address *ends*. -rob