To do foo
- Start in a fresh xterm
- Start in a fresh shell (typicaly csh)
- Log out and log in again so that you get a clean environment
While this may be good advice, certainly good advice for debugging brokenesses and/or avoiding bugs in the first place - it is basically an admission that something is not right.
Some tool depends on the environment in weird ways.Possibly not just the standard UNIX environment string;possibly also the extended shell environment.
Tools should be callable from almost arbitrary environments. They should not DEPEND on environment variables. It may be acceptable to USE environment variables to change some behaviors, but, consider: if you had a setuid script, it would probably be unwise to depend on environment variables. Environment variables should be considered tainted.
I suppose my version of the above is to say
To do foo
- Empty all of your environment variables, and start off with a minimum environment
- Type the absolute path to the tool,/a/b/.../c/d/tool
IMHO tools should work when invoked like this. If they are using the equivalent of Perk FindBin, they should be able to locate all of the relevant library files, etc., they need. Or else they should have, embedded in them, the paths to same.
GLEW OPINION: much of the reason for environment abuse is the broken, non-object oriented, UNIX installation model, where a tool may be put in /bin, its libraries in /usr/lib, etc - where the directories are not known at build time. PATH, LIBPATH. MANPATH. FindBin can live with this - a FindBin script can be relocated by copying - so long as the relative locations of what it depends on are maintained.
No comments:
Post a Comment