The problem seems to be that certain programs do not recognize the existence
of certain environment variables. The programs are CVS, man, and JDK javac,
and the variables are CVSROOT, MANPATH, and CLASSPATH respectively. I had
forgotten about the problem until I just recently changed shells at my new
job (from csh to zsh), effectively disabling both man and javac. The
problem seems to be with variables previously (in csh) set with setenv.
I would love to hear any advice you have on this matter.
Timothy Michael Doyle
-----------------------------------------------
tdo...@firstquadrant.com
626.683.4232 (work)
626.449.0181 (home)
107 South Chester Avenue #5, Pasadena, CA 91106
I've had this problem with the lowercase "cdpath" environment variable
too. A program here at work looks for it and under zsh it comes back
null. CDPATH exists, of course, but the program I mention doesn't look
for that....
--Nik
Nothing is easy.
);
env = getenv(argv[1]);
printf("%s\n", argv[1]);
printf("%s\n", env);
exit(EXIT_SUCCESS);
}
This is all in version 3.0.5.
--Nik
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