environment-variables

(Windows) Permanently altering a user's %PATH% via batch or Python

I'm packaging a Python project with setuptools and distributing it with easy_install, which allows me to place an executable file in a Scripts directory, hidden away inside the Python directory. For Linux users who run easy_install as root, there will be added a symbolic link in a standard bin directory (/usr/bin/, iirc). For Windows u...

How to custom display prompt in KSH to show hostname and current directory?

I'm using Korn Shell on Solaris and currently my PS1 env var is: PS1="${HOSTNAME}:\${PWD} \$ " And the prompt displays: hostname:/full/path/to/current/directory $ However, I'd like it to display: hostname:directory $ In other words, how can I display just the hostname and the name of the current directory, i.e. tmp or ~ or public_h...

change current process environment

Is it possible to change current process environment variable? More specifically in a python script I want to change LD_LIBRARY_PATH so that on import of a module 'x' which depends on some xyz.so, xyz.so is taken from my given path in LD_LIBRARY_PATH is there any other way to dynamically change path from where library is loaded? Edi...

How can you access the base filename of a file you are sourcing in Bash

I am sourcing a file in a bash terminal that needs to export some environment varibles. Example: source linux_x86.env the env file looks kinda like this: export ARCH=/home/user/project/linux_x86 I have a bunch of different architectures to compile for and I want be able to do something like this: export ARCH=/home/user/project/...

How to fail a Maven build on a missing parameter?

I have a environment variable or jvm parameter which must be present. How do I get Maven to fail if this parameter does not exist? ...

Erlang: How to access CLI flags (arguments) as application environment variables?

How does one access command line flag (arguments) as environment variables in Erlang. (As flags, not ARGV) For example: RabbitMQ cli looks something like: erl \ ... -sasl errlog_type error \ -sasl sasl_error_logger '{file,"'${RABBITMQ_SASL_LOGS}'"}' \ ... # more stuff here If one looks at sasl.erl you see the line: get_sasl_error_lo...

How to get environment from a subprocess in Python

I want to call a process via a python program, however, this process need some specific environment variables that are set by another process. How can I get the first process environment variables to pass them to the second? This is what the program look like: import subprocess subprocess.call(['proc1']) # this set env. variables for ...

Configure log4cxx to write a file to the user APPDATA directory

Hi all, I just recently built the latest version (which is several years old I think) version of log4cxx and am trying to write a log file to the user APPDATA path: C:\Documents and Settings\%user%\Application Data\Logs\Application.log but I can't seem to get the configuration right: log4j.rootLogger=DEBUG, A1 log4j.appender.A1=org....

Scons in Scratchbox: Can't find g++

Hello, I've been using sbox with a Make-based codebase with no problems. Now I'm using a scons-based codebase, and am getting some odd problems. It seems that within scratchbox, scons can't find g++. For example, it attempts to execute things like: o hello hello.c When it should be doing: g++ -o hello hello.c So presumably its g++ s...

How to Link to the Correct Profiler by Setting the COR_PROFILER Environmental Variable

In my code I need to set a process to connect it to a certain profiler. I understand that this is what I would have to do: ProcessStartInfo processStartInfo = new ProcessStartInfo(exePath); processStartInfo.EnvironmentVariables["Cor_Enable_Profiling"] = "0x1"; processStartInfo.EnvironmentVariables["COR_PROFILER"] = "{B146457E-9AED-4624-...

environment variables propagation on Windows system...

It is possible to propagate in already opened application the value(environment variables of Windows) of a variable of Windows after its creation or its modification without having to restart the applications which turn? How to? Perhaps, using server fault to post a such question would be better? ...

Accessing OS X / UNIX environment variables in Emacs minibuffer

Hi all, I compiled Emacs 23 on OS X Leopard and I am loving it. But one thing I noticed when I switched from Aquamancs is that I am no longer able to access my environment variables that I specify in my .bash_profile file. For instance, I have a line: export WORK=/Users/myname/Documents/otherpaths/Work So to open files I can type in t...

Why does Perl's glob return undef for every other call?

I'm not necessarily looking for a better way to do this, rather an explanations of the output would greatly be appreciated. Recently, a senior programmer asked me why his code worked but only for one instance. What I came to find out was that it worked every other occurrence. Here is my example: #!/usr/bin/perl -w use strict; my @li...

Access environment variable from java servlet.

I would like to know if there is any way I can access an environment variable from a java servlet. I know that I can pass params to the servlet using web.xml but I need to pass some value at run-time. The requirement is something like this - A non-web based app running at the server side sets some value (environment variable) and it ...

GNU Screen: Environment variables

[Updated] The question is related to the questions GNU Screen: Programmers quotes in Readbuf and GNU Screen: files to numbered buffers?. Since they are not solved, the question targets more general concept about environment variables. My belief is that they are the key to make Screen more efficient. 1. How can I use Bash's variables in ...

Why don't the keys with empty string values for Perl's %ENV show up Windows subprocesses?

I want to (need to) start a sub-process from a perl script that checks certain environment variables. In one instance the environment variable needs to be there but empty. $ENV{"GREETING"} = "Hello World"; # Valid $ENV{"GREETING"} = ""; # also valid I can set $ENV{"GREETING"} = ""; and in that perl script $E...

Set environment variable for build in hudson

I am trying to put a maven2 project under continuous integration in hudson. The project uses selenium for some integration testing. Hudson is running on a headless linux. I am using xvfb to start a x server session for selenium. In order to run the tests, I need to export an environment variable named DISPLAY. e.g. export DISPLAY=:99 ...

How do I add `java` to the command path on Vista?

I have JDK installed in Vista. I want to run java from the command line. How do I configure the path variable? If I'm not able to set the JAVA_HOME variable, what is an alternative? ...

WiX installer - environment variables do not expand %APPDATA%

In a .wxs file I have: <Environment Name="PATH" ... Value="%APPDATA%\Python\Scripts" system="no"/> Unfortunately this does not seem to work. After installing the installer on another machine, I do see that '%APPDATA%\Python\Scripts' is contained in the PATH environment variable. But typing 'foo' (where foo.exe exists in that set path)...

Reload Environment Variables in C# after launch

We received a new code base that uses environment variables all over the place. They point to things like the project root, assets, different tools, etc. Not the most ideal situation but it works. However, when it comes time to try and run our automated build it becomes a giant pain. Windows seems to instance the environment varia...