Geoff Kuenning wrote:
I don't mean that the shell should ignore ALL environment variables;
that would break a ton of scripts. Even ignoring PATH would be a Very
Bad Thing, since we've long ago grown used to inheriting PATH.
Ignoring PATH would make life much, MUCH harder. I just finished writing
a script that relies on PATH being set a particular way; in fact, I even
check that it is and refuse to run otherwise. (Ok, I guess I could set
the path myself, but it's for a development environment, and making the
user do it means less chance for them to shoot themselves in the foot
later because PATH is set wrong. Oh, and if ALL environment variables
were ignored, I wouldn't even be able to fix PATH, because I need a
different environment variable to know where the source tarball got
unpacked... or else, the script would have to instead make assumptions
about the current directory. So, ah, yeah, ignoring PATH would IMO be
bad, ignoring /everything/ would cause me to find another shell that's
less fatally brain-dead ;-).) And I know I have umpteen scripts floating
around that are intended to run in a particular environment and will
break otherwise. So... yeah, let's not go there ;-). (I wouldn't be
surprised if CDPATH is the same way, to be honest, i.e. I wouldn't be
surprised if there are scripts that require it to be set a particular way.)
BASH_ENV
Hmm, I know I rely on that, but maybe for starting new bash instances
(i.e. set from script and rely on the new shell to inherit it). But I
guess that's sort-of the whole point of the variable in the first place,
so...
HOME
Again, if bash were to start ignoring HOME, I'm fairly sure that would
break a bunch of my scripts. (Yeah. I have a particular environment in
which I abuse HOME, setting it to something other than my home
directory, but...)
PATH
See above ;-), but I guess you were already convinced that mucking with
this would be a problem, so that's good :-).
--
Matthew
In the beginning, there were not enough colors. -- Guy Keren