environment-variables

Batch files, $ : and ~

Hello all :) I've been writing an application which will need to expand environment strings in a file. To that effect, I could use the standard windows API function, ExpandEnvironmentStrings: http://msdn.microsoft.com/en-us/library/ms724265(VS.85).aspx I do have a few problems with that function though. First: The size of the lpSrc an...

nmake - how to forward macros between nmake invocations?

Hi How can I forward macros between nmake invocations? Let's say we have --- a.mak --- some_variable = value all: nmake -f b.mak --- END --- --- b.mak --- all: @echo some_variable = WHAT TO PUT HERE TO GET VALUE OF some_variable? --- END --- I was trying different things like using set and setx commands but value of vari...

How can I forward macros between nmake invocations from callee to caller?

How can I forward macros between nmake invocations from callee to caller? It's the reverse of what I was asking here: nmake - how to forward macros between nmake invocations? ...

.net Determine at run time whether my app is an exe or a web app.

I'm sure I have done this before in the past, but I've been in the docs for a bit, and can't seem to find it again. I need to be able to determine at run time in my business domain what context my application is running in. So that I may do some switching with config files, and use the proper method to determine if I am running in debu...

Launch mac eclipse with environment variables set

My company provides an eclipse based development environment which needs some environment variables setting up for the underlying toolchain so multiple versions can be installed concurrently and not take over the system. I want to provide an icon in finder or the dock which sets these then launches eclipse so customers cannot accidental...

Using Environment variables in T-SQL

How can I read the value of a system environment variable in a T-SQL script? This is to run on SQL Server 2005. ...

Is it possible to use environment variables in php.ini?

Rather than hard-wiring some paths in my php.ini configuration, I'd like to configure them using system variables that are shared in some other places such as my Apache configuration. I've done some searching and couldn't find the right mix of keywords to discover if there's a way to do this. Does anyone know if this can be done? uplo...

How to shorten an inittab process entry, a.k.a., where to put environment variables that will be seen by init?

I am setting up a Debian Etch server to host ruby and php applications with nginx. I have successfully configured inittab to start the php-cgi process on boot with the respawn action. After serving 1000 requests, the php-cgi worker processes die and are respawned by init. The inittab record looks like this: 50:23:respawn:/usr/local/b...

How to get environment variables from within gvim

When I start gvim from withing a terminal, I can access my all environment variables. But if I launch gvim from a menu or from the "Run application" launcher, all my environment variables are not accessible. How can I access the environment variables defined in my bashrc if gvim is not launched from a terminal ? These variables are de...

Is there an easy way to convert HTTP_ACCEPT_LANGUAGE to Oracle NLS_LANG settings?

When adding internationalisation capabilities to an Oracle web application (build on mod_plsql), I'd like to interpret the HTTP_ACCEPT_LANGUAGE parameter and use it to set various NLS_* settings in the Oracle session. For example: HTTP_ACCEPT_LANGUAGE=de alter session set nls_territory=germany; alter session set nls_lang=... However...

Can I pick up environment variables in vbscript WSH script?

Is is possible to read system environment variables in a Windows Scripting Host (WSH) VBS script? (I am writing a VBScript using Windows Scripting Host for task for a Cruise Control and want to pick up the project build URL.) ...

Manual Installation of Glassfish on Ubuntu

I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything went well. But now when I'm trying to play with ASADMIN tool it's telling me this: The program 'asadmin' is currently not installed. You can install it by typing: apt-get install glassfishv2 -bash: asadmin: command not found So, in order ...

What is the most secure way to retrieve the system Drive.

I know that the following should work: Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine) My problem with this call is that if for some reason someone decided to remove the "windir" Env Var , this won't work. Is there an even more secure way to get the System drive? ...

Bash condition of the form - [ -n "${VAR:-x}" ] gets evaluated even though VAR is set

Hi all, I have written an if statement of the form: if [ -n "${VAR:-x}" ]; then #do something export VAR=#something fi My shell script calls this statement twice and surprisingly passes the condition twice. [hint (perhaps...): This exact code is repeated in a function in an included file. The if statement is first evaluated pr...

Automatically switch between SVN branches of the same project

How can developers set up their environment paths when working on different SVN branches of the same project so that they don't need to setup their paths each time they switch from one branch to another? I am a Python developer and I find myself working on different branches of the same project and it's pretty ugly to export each time ...

Python Environment Variables in Windows?

I'm developing a script that runs a program with other scripts over and over for testing purposes. How it currently works is I have one Python script which I launch. That script calls the program and loads the other scripts. It kills the program after 60 seconds to launch the program again with the next script. For some scripts, 60 sec...

Resolve Windows environment variables in PHP

I want to write to a file in the windows temp directory. I know that in the command line you can use the environment variable %TEMP% to get the right path, however trying to do something like this: file_put_contents("%TEMP%\\myfile.txt"); ...does not work because the environment variable isn't being resolved. Is there a way to do this...

Persist an environment variables after app exits

Is it possible to persist an environment variable in a console application which is available after the process has exited. I want a console application to set a string which is available to the batch file which executed it. The console application is in dotnet. ...

define ant property from environment with default value

Hello Friends, I would like my build script to act property for release and development environments. For this I would like to defined a property in ant, call it (for ex.) fileTargetName fileTargetName will get it's value from the environment variable RELEASE_VER if it's available, if it is not available it will get the default value ...

How can I maintain separate PATH variables for 32 and 64 bit applications?

I am moving to a 64 bit Windows workstation, and will be developing both 32 and 64 bit applications. I will need to maintain different PATH environment variables when running a 32 vs. 64 bit version of my application. What is the best way to do this? It seems like it should be possible with all of the registry redirection that goes on...