From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id RAA00251 for ; Wed, 7 Aug 1996 17:39:04 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id DAA13307; Wed, 7 Aug 1996 03:36:26 -0400 (EDT) Resent-Date: Wed, 7 Aug 1996 03:30:38 -0400 (EDT) Message-Id: <199608070729.JAA29678@hydra.ifh.de> To: Rik Faith , zsh-users@math.gatech.edu Subject: Re: local after setopt allexport? In-reply-to: "faith@cs.unc.edu"'s message of "Tue, 06 Aug 1996 15:38:48 MET." <199608061938.PAA07278@proteus.cs.unc.edu> Date: Wed, 07 Aug 1996 09:29:22 +0200 From: Peter Stephenson Resent-Message-ID: <"Z_r5M3.0.-E3.UO42o"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/346 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu faith@cs.unc.edu wrote: > Is there a way to keep variables from being exported after setopt > allexport? Variables are only exported when set, so you can temporarily unset the option and set the variable in a shell function to get this effect. You might need to make `noexport' more sophisticated. % setopt allexport % foo=bar % printenv foo bar % unset foo % noexport() { setopt localoptions; unsetopt allexport; $1=$2; } % noexport foo bar % printenv foo % print $foo bar -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.