From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 16 Dec 2008 09:18:00 -0800 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> Subject: Re: [9fans] sam/rc script problem In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Topicbox-Message-UUID: 62d7acfa-ead4-11e9-9d60-3106f5b1d025 > why do I get, running rc in linux (plan9port) > ----------------------------- > ; sam -d outit > -. outit > $-/FERMI/+- > FERMI LEVEL= 0.01 ITER= 70 > q > ----------------------------- > ----------------------------- > ; sam -d outit < $-/FERMI/+- > q > EOF > -. outit > FERMI LEVEL= 0.07 ITER= 1 > ----------------------------- > > that is, the second way finds the 1st occurence in the file while I > want the last one (as in the first case)?! > In Plan9 it works the same in both cases! It works the same in both cases on Plan 9 only accidentally. It turns out that $-/FERMI/ is the same as -/FERMI/ -- if you are searching backward it doesn't matter whether you start at $ or at the beginning of the file. On Plan 9: cpu% cat <