Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: local after setopt allexport?
- X-seq: zsh-users 346
- From: Peter Stephenson <pws@xxxxxx>
- To: Rik Faith <faith@xxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: local after setopt allexport?
- Date: Wed, 07 Aug 1996 09:29:22 +0200
- In-reply-to: "faith@xxxxxxxxxx"'s message of "Tue, 06 Aug 1996 15:38:48 MET." <199608061938.PAA07278@xxxxxxxxxxxxxxxxxx>
faith@xxxxxxxxxx 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 <pws@xxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author