From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4421 invoked from network); 17 Jul 1998 13:31:25 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (203.24.36.3) by ns1.primenet.com.au with SMTP; 17 Jul 1998 13:31:25 -0000 Received: (qmail 2746 invoked from network); 17 Jul 1998 13:30:57 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns2.primenet.com.au with SMTP; 17 Jul 1998 13:30:57 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id JAA04979; Fri, 17 Jul 1998 09:20:12 -0400 (EDT) Resent-Date: Fri, 17 Jul 1998 09:20:12 -0400 (EDT) Sender: domivogt@hp.com Message-Id: <35AF4FB0.1018@hp.com> Date: Fri, 17 Jul 1998 15:20:48 +0200 From: Dominik Vogt X-Mailer: Mozilla 3.0 (X11; I; HP-UX B.10.20 9000/712) Mime-Version: 1.0 To: mason@primenet.com.au Cc: zsh-workers@math.gatech.edu Subject: Re: bug with chpwd/allexport References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <"noqNz3.0.kD1.B-qhr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4237 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi, > :# export PS1='%~>' > :~ > setopt ALLEXPORT > :~ > setopt AUTONAMEDIRS > :~ > function chpwd () { > :> FOO=$PWD > :> echo $FOO > :> } > :~ > cd /etc > :/etc > :$FOO > > ^^^^ You mean "~FOO >" Granted. > > :There is a simple workaround: > :function chpwd () { > : setopt LOCALOPTIONS > : unsetopt AUTONAMEDIRS > : unsetopt ALLEXPORT > : FOO=$PWD > : echo $FOO > :} > > Simple workaround 1: > chpwd () { > echo $PWD > } > > Simple workaround 2 (in case we're only seeing a fragment of your chpwd() ): > chpwd() { > local FOO=$PWD > echo $FOO > } The 'echo $FOO' was just an EXAMPLE to reproduce the problem! Think of a more complicated way someone builds the variable FOO and doesn't want to put it all on one line. BTW if the second workaround you suggest works, then it is a bug. The manpage states clearly, that a local variable is still exported if the ALLEXPORT option is set and the variable was prviously unset. > BTW, do you have a good reason for setopt'ing ALL_EXPORT? Why polute your > environment in that manner? Bye Dominik -- ------------------------------------------------------------------------ Dominik Vogt phone: 07031/14-4596 Hewlett-Packard GmbH fax: 07031/14-3883 Boeblingen Verification Solutions Herrenberger Str. 130 71034 Boeblingen email: dominik_vogt@hp.com ------------------------------------------------------------------------