environment-variables

Run bash with redefined PS1 env variable

Hi, guys! I have written cpp aplication called MyShell that takes as the params some real shell name (generally bash) and its params. MyShell works as a wrapper for it. I need to change command prompting for the inner shell, specifically the PS1 environmental variable. I know how to do it command-line way using PS1 env var: $ PS1="[m...

Is it possible to "unset" an environment variable in a Makefile?

I'm using GNU make, and including a 3rd party library in a project that has a build system that goes berserk if CFLAGS is defined in the environment when it is called. I like to have CFLAGS defined in my environment for other reasons. The library's build is being invoked from another makefile, so that I say e.g.: 3rdparty: $(MAKE)...

LaunchDaemons and Environment Variables

For a while now, I've been noticing that my MacPorts-installed Apache2 instance hasn't been starting when I start up (http://stackoverflow.com/questions/2042992/macports-apache2-stopped-launching-on-boot). The LaunchDaemon is loaded. Today I bumped into something in a log file that may point to an answer, but I can't find any confirmatio...

Can a Ruby script tell what directory it’s in?

Hello, everyone! Inspired by this question, what's the Ruby way to do this? ...

Where can I set environment variables that crontab will use?

hey all, I have a crontab running every hour... The user running it has evironment vars 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. Anyone know...

export C #defines as shell variables

In my project, a number of paths to various directories, files and other components of the system are stored as #defines in a filenames.h, a file included by all that need them. It works well for all the various binaries generated by compilation, but the project also includes a few shell scripts that use the same paths. Currently this me...

How do I set environment variable completion in a bash shell on mac

In a bash shell on linux, if I type: echo $DISP and hit tab, it completes to: echo $DISPLAY It doesn't work in bash on OSX 10.5, and I'm using the same .bashrc Is there a shell option or setting I can use to set this. ...

MySql environment variable on windows

I have installed Mysql on my localhost and it works fine with phpMyAdmin. I have set my CLASSPATH to C:\xampp\mysql\bin\ but when I try and run 'mysql' from the command line it doesnt recognise it. If I navigate to C:\xampp\mysql\bin\ in the command line I can run mysql commands fine. Any ideas? Thanks, Joe ...

Storing Amazon S3 credentials in .bashrc environemental variables causes Rails app to fail

I appologise in advance for the length of this post.... I'm developing a rais app that uses paperclip to store stuff on Amazon S3. The app is hosted on Heroku. I'm developing on Ubuntu Karmic. The problem that I am about to describe occurs in development (on my localhost) and production (on Heroku). The standard way of passing S3 cr...

CakePHP, Set "cake" Environment Variable?

Here's a quickie that I assume has a simple answer (maybe? Hopefully?), but I just can't find one: I'm using the "cake" console in cakephp on Mac OS X 10.6.2. How do I set up the environment variable (or PATH?) so that all I need to type in terminal is "cake"... as opposed to the full path to the console app? I'm unabashedly a newb wh...

Regarding application.properties file and environment variable

In my application.properties file if I have the path configured like below Java successfully recognizes the path. pathToInputFile=/kcs/data/incoming/ready/ pathToInputFileProcess=/kcs/data/incoming/work/ If I have the below way using environment variable Java program doesn't recognize the path Environmental variable TOM_DATA is set ...

Include syntax on MASM32

When including files into MASM32, it cannot find it's own files. After including masm32rt.inc, the assembler cannot find \masm32\include\windows.inc Apparently most MASM system include files begin with \ instead of specyfing a relative or absolute path. I tried specifying the directory in %PATH%, setting the /I compile switch, and sett...

Update system environment variable from c++

Hey folks, I am currently writing an unmanaged C++ program which works with a system environment variable. I am getting the value with GetEnvironmentVariable(...). Now I have an C# program which may change this variable at any time, e.g. like this: Environment.SetEnvironmentVariable("CalledPath", System.Windows.Forms.Application.Execut...

how do I use c preprocessor to make a substitution with an environment variable

In the code below, I would like the value of THE_VERSION_STRING to be taken from the value of the environment variable MY_VERSION at compile time namespace myPluginStrings { const char* pluginVendor = "me"; const char* pluginRequires = THE_VERSION_STRING; }; So that if I type: export MY_VERSION="2010.4" pluginRequires will be se...

ASP.NET MVC - How are windows environment variables handled?

This question is also related to my other question ASP.NET MVC - Website Paths. I have a 3rd party component which has hard-coded directory paths compiled into the assembly. An example of one of the paths is: %APPDATA%\Vendor\Product\settings.ini So if I create a console application/windows service and run it under my account on my ma...

csh idioms to check for environment variable existence?

I've got a few csh scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing: if ! $?STATE then echo "Need to set STATE" exit 1 endif if ! $?DEST then echo "Need to set DEST" exit 1 endif which is a lot of typing. Is there a more elegant idiom for c...

What determines the return value of Path.GetTempPath() ?

Currently, I use Path.GetTempPath() to figure out where to write my log files, but recently I came across a user's machine where the path returned was not what I expected. Usually, the returned path is C:\Documents and Settings\[userid]\Local Settings\Temp but in this case, it was C:\Temp This would not normally be a problem, but for s...

Java environmental variable woes, maven also

So I re-installed java in a directory that doesn't have any spaces in it, as I was having issues with it before. Java JDK is installed in: E:\downloads\java\jdk I created a User variable: JAVA_HOME E:\downloads\java\jdk And my Path looks like: %JAVA_HOME%\bin;%M2%; Now opening a NEW cmd prompt: c:\java 'java' is not recognized...

ExpandEnvironmentStrings Not Expanding My Variables

I have a process under the Run key in the registry. It is trying to access an environment variable that I have defined in a previous session. I'm using ExpandEnvironmentStrings to expand the variable within a path. The environment variable is a user profile variable. When I run my process on the command line it does not expand as well. I...

Visual Studio: How to add existing project using environment variable?

I have a a project that resides on a "thumb drive" (a.k.a. memory stick). Due to Windows ability to change drive letters of thumb drives, I would like to specify the location of sub-projects using an environment variable. This allows me to set the thumb drive drive letter, depending on the PC that I am using; or change the variable whe...