From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15324 invoked from network); 4 May 1998 10:59:01 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 4 May 1998 10:59:01 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id GAA21062; Mon, 4 May 1998 06:40:50 -0400 (EDT) Resent-Date: Mon, 4 May 1998 06:40:50 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980504034103.ZM3129@candle.brasslantern.com> Date: Mon, 4 May 1998 03:41:03 -0700 In-Reply-To: Comments: In reply to mason@primenet.com.au (Geoff Wing) "Re: env variables" (May 4, 3:39am) References: <199805012044.NAA22048@wank.pdi.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: Re: env variables MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"rFGrQ3.0.195.niPJr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3923 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On May 4, 3:39am, Geoff Wing wrote: } Subject: Re: env variables } } Nik Gervae typed: } :> Arrays aren't exported, because there's no standard or de facto } :> method of exporting arrays, so nothing would understands them } :Hmm. That sounds slightly fishy in that csh happily exports array } :variables, but then csh is bogus in so many ways.... } } Not as arrays. In fact, I can't see it doing it at all. The problem is not really with exporting arrays ... the problem is with exporting a variable whose name happens to be the same as one of zsh's special array variables. In the case in question, some program wants a variable named "cdpath" to be in the environment. It probably expects that to be a colon-separated string, but it doesn't really matter what it expects, because zsh won't put a variable named "cdpath" in the environment. It actively removes such a variable from the environment if it happens to be there when the shell starts up. This is one reason I've always preferred csh's model of keeping local and environment variables in completely separate namespaces. (The icky bit about the csh model is that you still refer to both with $xxx, so you can't tell what namespace you're referencing.) (No, zsh should not change models.) The only workaround is to export the variable for a single command only, like so: cdpath=$CDPATH printenv In older versions of zsh, that would have clobbered both cdpath and CDPATH for the current shell, but fortunately that's fixed in current releases so you can use it safely. Hmm; hey, Peter, another FAQ entry? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com