From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <20060809110352.GA5077@shodan.homeunix.net> References: <3d0bbd780608040237i5a944f1es6e73fbc2395403bd@mail.gmail.com> <44D31796.7050507@gmail.com> <676c3c4f0608040815s5cdddf17xb080bfeac5b0fcd9@mail.gmail.com> <599f06db0608041203m351f1f7dkcb6c44f9d14b71d7@mail.gmail.com> <02E129D3-32DF-41CC-9026-46BAA1FF8133@ar.aichi-u.ac.jp> <20060809110352.GA5077@shodan.homeunix.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <00A70127-4D3A-4598-ABCD-29EBEB74B183@ar.aichi-u.ac.jp> Content-Transfer-Encoding: 7bit From: arisawa@ar.aichi-u.ac.jp Subject: Re: [9fans] Environment variable Date: Wed, 9 Aug 2006 20:16:34 +0900 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 9adf56dc-ead1-11e9-9d60-3106f5b1d025 Thanks Martin, Then, how to bring up an environment variable a to a shell variable b? command b=`{cat /env/a} does not work all the time. On 2006/08/09, at 20:03, Martin Neubauer wrote: > Hello, > > I don't think that this really is weird. My understanding is that > the terminating '\0' is not treated as part of the content of a > string but merely of its representation in memory. So if you output > a null string, you don't actually output anything (and therefore > assign nothing to $b). That then explains why xd fails to open $a > (which is an actual string, albeit with length zero) and waits for > standard input because $b isn't expanded to anything. > > I hope my attempt at an explanation wasn't utter nonsense and helped > clarifying a bit. > > Regards, > Martin