From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 9 Aug 2006 14:26:20 +0200 From: Martin Neubauer To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Environment variable Message-ID: <20060809122620.GF5077@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> <00A70127-4D3A-4598-ABCD-29EBEB74B183@ar.aichi-u.ac.jp> <20060809112709.GB5077@shodan.homeunix.net> <20060809113942.GC5077@shodan.homeunix.net> <96B9C0FD-D1B1-4374-B247-1DCE7109C75C@ar.aichi-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96B9C0FD-D1B1-4374-B247-1DCE7109C75C@ar.aichi-u.ac.jp> User-Agent: Mutt/1.4.2.2i Topicbox-Message-UUID: 9b18842a-ead1-11e9-9d60-3106f5b1d025 * arisawa@ar.aichi-u.ac.jp (arisawa@ar.aichi-u.ac.jp) wrote: > > On 2006/08/09, at 20:39, Martin Neubauer wrote: > >Well, now I have tried. It doesn't do the trick. > >b=`{cat /env/a}^'' > >gives a warning if a is an empty string but works otherwise. > >b=$`{basename /env/a} > >is the cleanest solution, I think. > > The solution is same as > b=$a > this works if a is already a shell variable. > > Try > c='' # null string > a=() > b=() > cp /env/c /env/a > then exec > b=$`{basename /env/a} I see what you are trying to accomplish. Probably b=$"`{cat /env/a} will do.