environment-variables

Exporting an Environment Variable in Ruby

How do I export an environment variable from within a Ruby script to the parent shell? For example, implementing a naïve implementation of the read Bash builtin: #!/usr/bin/ruby varname = ARGV[0] ENV[varname] = STDIN.gets # but have varname exported to the parent process ...

Why do Windows environment variable names use a special escape character?

I am curious if there is any history behind why the ^ character is used to escape the special characters <, >, |, &, and ^ in environment variable names in Windows instead the \ character that is typically used to escape special characters. Please note that I realize there may be no reason for this, but I'd be interested to hear if ther...

Where is the best place to store globals in Rails app?

Hello. I was wondering if there is the best practice on where to store global settings in a rails app. What I mean by that is i.e: I have a few globals defined that may change, but not likely and it seems inappropriate to store them in DB since they are used so much. For instance I have SYSTEM_EMAIL & SYSTEM_EMAIL_SIGNATURE & SYSTEM_STO...

Oracle sqlplus instantclient and xe env variables

Hi I'm installing Oracle XE and sqlplus on Oracle Enterprise Linux 5. What environment variables do I need? I think that both require different ORACLE_HOME and LD_LIBRARY_PATH. Thanks ...

commons-exec: Executing a program on the system PATH?

I'm trying to execute a program (convert from ImageMagick, to be specific) whose parent folder exists on the path. Ergo, when I run convert from the command line, it runs the command. The following, however, fails: String command = "convert" CommandLine commandLine = CommandLine.parse(command); commandLine.addArgument(...) ... int exitV...

Are Apache Environment Variables "request safe"?

I have my Apache web server fronting a Rails application. When a request comes in one of the Apache modules looks at the request and puts information into an Apache environment variable. My question is, is there a chance that one request can overwrite the environment variable of another request and have things get mixed up in the Rails l...

libclntsh.so.11.1: cannot open shared object file.

I want to schedule a task on linux by icrontab, and the task is written in python and have to import cx_Oracle module, so I export ORACLE_HOME and LD_LIBRARY_PATH in .bash_profile, but it raise the error: libclntsh.so.11.1: cannot open shared object file. Since it is ok to run the task by issue the command in shell like python a.p...

How to override environment variables when running configure?

In any major package for Linux, running ./configure --help will output at the end: Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS ...

How can I define Makefile variables from a Perl script?

I am creating a Makefile which I want it to be a single file for different architectures, OSes, libraries, etc. To do this I have a build specific XML file which defines the different configuration options for each architecture. The config file is read by Perl (it could be any language) and the Perl output returns something like: var1...

Adding program to mingw32's "path"

I am running a rails app locally through NetBeans which seems to be running ruby through mingw32. I'm trying to do a system call to lame, which works fine using just irb, but this particular setup can't find it! What can I do to tell mingw/this instance of rails where lame is? ...

set windows PATH environment variable at runtime in Java

I have a java program that fires off an executable using the Runtime.exec() method. I'm using the variant that takes in a set of command line params as one argument, and some environment variables as another argument. The environment variable I'm tryign to set is path, so i'm passing in "PATH=C:\some\path". This does not work. Is there...

Debug CGI by simulation

I basically want to debug a cgi programm with gdb by emulating the environment variables and stdin stream. How do I set the variables and stdin? I am using lampp and gdb. Thanks! ...

How to remove a folder named ${env.CATALINA_HOME} from an Subversion repo

I pulled a stupid and accidentally committed a folder named ${env.CATALINA_HOME} to my subversion repo. I tried doing an svn rm /path/to/${env.CATALINA_HOME} but it says "bad substitution" which I'm guessing means that it cant figure out why i'm using ${} notation in the path. I also tried surrounding the path in quotes, to no avail. Su...

How can I set environment variables depending on directory

If I have 'export BLA="hey there"' in .profile in my home directory, how can I change this later in other directories just by cd into the other directory? Also, is there a way to just set a new environment variable when I cd into a directory. My first attempt was to just make another .bashrc file in the directory where I want the change...

Environment Variable to determine the OS type (Windows XP, Windows 7)

I want to differentiate between Windows XP and Windows 7 in a XML file. Thought i will use an environment variable for it inside the XML. However I could not find any system environment variable defined in windows that gives this information. I see the %OSTYPE% variable but it is only available in Windows 7. It is not defined in XP. ...

[XCode] How to reference files with environment variables ?

Hi, I was wondering if someone manage to reference files (except headers or lib) with an environment variable in XCode (mine : v3.2.1) ? There are settings that specify search paths for headers (HEADER_SEARCH_PATHS), libs (LIBRARY_SEARCH_PATHS), and even Carbon Resource (REZ_SEARCH_PATH). But how can I reference other file types for re...

Allowed characters in linux environment variable names

What characters are allowed in linux environment variable names? My cursory search of man pages and the web did only produce information about how to work with variables, but not which names are allowed. I have a Java program that requires an defined environment variable containing a dot, like com.example.fancyproperty. With Windows I c...

Exporting a variable from a Windows batch file to Cygwin

I want to initialize my Cygwin environment with a variable coming from a batch file @set myvar=test %BASH% --login -c "set" REM hope to see myvar So I want myvar with its value eventually be available in bash. ...

Java Classpath Problems in Ubuntu

First off I'm running Ubuntu 9.10 I've edited the /etc/environment file to look like this: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.20" CLASSPATH="/home/travis/freetts/lib/freetts.jar:/home/travis/freetts/lib/jsapi.jar:." I then run "source /etc/environmen...

Ant ignores attempt to override the LANG environment variable

We need to test a java build with the languages set to different values. I can manually (i.e. via export LANG=en_DK.UTF-8 and export LANG=en_DK) test that the unit tests run with the ant build script behaves differently, but I need to set the environment variable from ant. I have tried setting it using these methods (with the shell $LANG...