environment-variables interview questions
Top environment-variables frequently asked interview questions
I'd like to know if it's possible from windows command line to list ALL environment variables.
Something equivalent to powershell gci env:
(or ls env:
or dir env:
).
Source: (StackOverflow)
Is it possible to set a environment variable at the system level from a command prompt in Windows 7 (or even XP for that matter). I am running from an elevated command prompt.
When I use the set
command (set name=value
), the environment variable seems to be only valid for the session of the command prompt.
Source: (StackOverflow)
I set an environment variable that I want to access in my Python application. How do I get this value?
Source: (StackOverflow)
I have a crontab running every hour. The user running it has environment variabless in the .bash_profile
that work when the user runs the job from the terminal, however, obviously these don't get picked up by crontab when it runs.
I've tried setting them in .profile
and .bashrc
but they still don't seem to get picked up. Does anyone know where I can put environment vars that crontab can pick up?
Source: (StackOverflow)
When I use any command with sudo the Enviroment Variables were not there for example when I set HTTP_PROXY it works fine with wget without sudo but when I type sudo wget it said It cant bypass the proxy setting.
Source: (StackOverflow)
Before installing gnuplot I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src
.
During the installation something went wrong; now I want to remove the GNUPLOT_DRIVER_DIR
environment variable.
Source: (StackOverflow)
I have a directory which hosts all of my Django apps (C:\My_Projects
). I want to add this directory to my pythonpath
so I can call the apps directly.
I have tried adding C:\My_Projects\;
to my Path
variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables
). But it still doesn't read the coltrane module and generates this error:
Error: No module named coltrane
Source: (StackOverflow)
I need to access an environment variable remotely. To do this I think the best way is to read it from registry.
Where are environment variables stored in registry?
Source: (StackOverflow)
I have a command that runs fine if I ssh to a machine and run it, but fails when I try to run it using a remote ssh command like :
ssh user@IP <command>
Comparing the output of "env" using both methods resutls in different environments. When I manually login to the machine and run env, I get much more environment variables then when I run :
ssh user@IP "env"
Any idea why ?
Source: (StackOverflow)
It looks like the launchd.conf
does not load my environment variable anymore.
Has anyone else noticed that?
Is there another solution to permanently set environment variables?
Source: (StackOverflow)
How can I get the client IP address using PHP?
I want to keep record of the user who logged into my website through his/her IP address.
Source: (StackOverflow)
Which of the following is the best and most portable way to get the hostname of the current computer in Java?
Runtime.getRuntime().exec("hostname")
vs
InetAddress.getLocalHost().getHostName()
Source: (StackOverflow)
I'd like gcc to include files from $HOME/include
in addition to the usual include directories, but there doesn't seem to be an analogue to $LD_LIBRARY_PATH. I know I can just add the include directory at command line when compiling (or in the makefile), but I'd really like a universal approach here, as in the library case.
Source: (StackOverflow)