different environment in each directory

Hi,
is it possible to have different environment settings for different directories / sub-directory for the same login??

All that I can think at the moment is creating different scripts say "env" in each directory for setting directory specific environment and also creating a wrapper script for "cd" which changes the directory and immediately calls the script "env".

Any other ideas??

:cool:

Normally, environment variables are set based upon a particular user. I am not sure that you can do it that way.

Most env variables are set in a .cshrc or .exec or .profile or .login file.

You could have different files like these and invoke them, but I am not sure how well that would work.

Try it and let me know.

:slight_smile:

What you propose should be workable, but I suggest that you think before you do this. It will result in a fundamental change to the way UNIX normally works. And this will blindside unsuspecting users who think that they understand UNIX. If you do proceed with this, print out a message when you change the environment.