Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tying multiple environment variables together
- X-seq: zsh-users 3816
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Steve Talley <stephen.talley@xxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: Tying multiple environment variables together
- Date: Wed, 11 Apr 2001 16:53:24 +0000
- In-reply-to: <20010411101801.D818@rmtc>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010411101801.D818@rmtc>
On Apr 11, 10:18am, Steve Talley wrote:
}
} Unfortunately when I change the value of one I have to change all
} three. Is it possible to tie the values together, so that after
} changing one they all get changed?
Not directly (though this sounds like a good basis for a zmodload
module of some kind). The easiest thing is to use precmd() to force
two of them to always match the third, e.g.
precmd() {
export JDKHOME=$JAVA_HOME
export JDK_HOME=$JAVA_HOME
}
Then always change JAVA_HOME when you want to change all of them.
I believe recent versions of ksh have a syntax for specifying set/unset
callbacks on parameters, so zsh will probably pick up that feature before
long.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author