What is a good practice to check if an environment variable exists or not?

Use the first; it directly tries to check if something is defined in environ. Though the second form works equally well, it’s lacking semantically since you get a value back if it exists and only use it for a comparison. You’re trying to see if something is present in environ, why would you get just … Read more

How to set the environment variable LD_LIBRARY_PATH in linux

You should add more details about your distribution, for example under Ubuntu the right way to do this is to add a custom .conf file to /etc/ld.so.conf.d, for example sudo gedit /etc/ld.so.conf.d/randomLibs.conf inside the file you are supposed to write the complete path to the directory that contains all the libraries that you wish to … Read more

Capabilities for Lua: what experience is there?

I can’t speak to Lua but for Javascript, Caja has tooling to create a proper sandbox, limiting access to only certain functions. It was originally created to build a sandbox for HTML/JS widgets (like those used on iGoogle). http://code.google.com/p/google-caja/ Here’s a description of the project from their homepage: Caja (pronounced “KA-ha”), is a Spanish word … Read more

System versus user PATH environmental variable…winmerge works only if I add the path to the user PATH

You must be getting something wrong, or have environmental problems with your machine. Adding a user PATH environment variable does result in it being merged into the environment of a new process. Update: Perhaps this comment from the MSDN topic on environment variables might be pertinent: Found out that on Windows Server 2003, once the … Read more