Environment variables are system-wide variables which share the same value. These variables are often parsed by the shell when executing commands, and are expanded into their appropriate variable. For example, this allows users to move file locations without needing to update hard-coded paths in ...

learn more… | top users | synonyms

12
votes
1answer
7k views

How can I set environment variables for GUI apps in OS X Mavericks?

I've been struggling to get an app to run in OS X Mavericks. I finally was able to get it to run by drilling into the .app bundle and running the shell script directly. It seems that JAVA_HOME needed ...
0
votes
1answer
26 views

Windows - How to use user defined environment variables in system path

As the question states, I have some variables defined in my user environment in windows 8.1. Now I want to have something like this as a path: C:\Program Files (x86)\Intel\iCLS ...
0
votes
0answers
29 views

How to recover from PATH being truncated to 1028 characters by SETX

I received an error on Windows 8 after trying to use SETX to add JAVA.exe to the Windows PATH variable: WARNING: The data being saved is truncated to 1024 characters. After a reboot, I notice that ...
1
vote
5answers
4k views

How do I substitute environment variables when I ouput a file?

I'd like to somehow spit out a file (which has env variable references) and substitute the actual values. This is what I've tried, but as you can see it's not working. Any ideas? -bash-3.00$ cat ...
0
votes
1answer
25 views

What file does OSX Mavericks look at to setup environmental variables for terminal

I changed something on my Mac and when I start terminal by simply clicking on the icon, none of the PATH variables are loaded to tell terminal where basic (or any commands) are. I have edited the ...
0
votes
2answers
2k views

Add a directory and all subdirectories to the PATH variable with a single entry

I've got a directory in my home folder in which I place command-line software (CMD_Software). I put each piece of software in its own directory within CMD_Software in order to avoid clutter. I would ...
0
votes
1answer
93 views

Phusion Passenger Showing Environment Variables

I'm getting some Phusion Passenger errors with Ruby On Rails Problem is it's showing my environment variables in the error report. This is great in development, but what happens if my server faulters ...
0
votes
2answers
31 views

cannot set JAVA_HOME

I'm running Linux Mint Quiana. I want to run Android Studio and this requires me Java. Since i needed NetBeans i decided to install NetBeans with Java 8 bundle from oracle's website. I tried for days ...
13
votes
5answers
11k views

Overcoming the 1024 character limit with setx

I am trying to set environment variables using the setx command, such as follows setx PATH "f:\common tools\git\bin;f:\common tools\python\app;f:\common tools\python\app\scripts;f:\common ...
2
votes
2answers
3k views

Setting proxy via http_proxy on Mac

I am using an HTTP proxy on MacOS 10.7 (which works for Safari.app, when set in the system preferences). I'm now trying to set the proxy for command-line applications using the $http_proxy environment ...
0
votes
2answers
22 views

CentOS. Set environment variable permanently

I used a following commmand in SSH terminal on my server: export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib and it works fine: my program finds all libraries at this point (if I launch it from my ...
8
votes
4answers
5k views

Why won't my Windows 8 Command line update its path

I needed to add a new entry to my PATH variable. This is a common activity for me in my job, but I've recently started using Windows 8. I assumed the process would be similar to Windows 7, Vista, ...
0
votes
1answer
34 views

Dynamically find Chrome on end-user's Windows machine

So, I have searched everywhere I can think of for this, and can't figure it out. I'm hoping the answer is very simple. Here is the situation: I am creating a shortcut link for an end-user. We will ...
1
vote
2answers
2k views

I overwrote my environment variable PATH

I've accidentally overwritten the environment variable PATH in Windows 8 (64 bit). How can I reset it? I'm scared to shut down the PC before fixing this problem. Otherwise I might copy it from ...
0
votes
1answer
334 views

Forcing programs to be installed to another drive

I have an SSD as my main Windows drive, with a 640GB 2.5" HDD, partitioned to store programs and user settings, and also to act as backup (it's the only thing I had lying around at the time of ...
0
votes
0answers
8 views

Unix environment variables for Unix-derived apps in Windows

My problem is that cross-platform apps initially written for Unix/GNU+Linux trash my Windows filesystem by placing files wherever they can. In most cases this can be solved by setting environment ...
4
votes
2answers
190 views

How to create a directory symbol like ~ for HOME?

I've got a directory path for which I want to create a shortcut, like ~ for a users home directory. I've tried the ENV variables, and I could match $<something> for a path, but I dont want ...
47
votes
2answers
86k views

Setting and getting windows environment variables from the command prompt?

This is a very basic question, but I can't find an answer. I want to set an environment variable from the command prompt and then be able to access it globally (for instance, I should see it by going ...
1
vote
0answers
21 views

php is not recognized as an internal or external command although it is available in commandline

this is somewhat of a tricky question when it comes to "where should I place it?", but I assume a general problem behind it, which is why I am putting it on superUser. I have a Doctrine script which ...
1
vote
3answers
2k views

How can I store encfs6.xml in another location (and still make it detectable)?

How can I make encfs4win search for the encfs6 file in another location? I tried modifying the encfs_mount.cmd file at the end, like so: set ENCFS6_CONFIG=c:/test1/.encfs6.xml %pathtoencfs%encfs ...
0
votes
2answers
3k views

Setting environment variables and appending to system-wide %PATH% with a Windows batch file

I'm trying to set three environment variables and append them to the machine path. Right now my code is like this: setx CATALINA_HOME "C:\Program Files (x86)\Apache Software Foundation\Tomcat 7" /m ...
0
votes
1answer
28 views

Assigning a Windows environment variable to a batch variable?

I can't seem to assign an environment variable to another one inside a batch script. For example, this will work: set varA=C:\this\is\a\directory and I can happily use find /I "MyString" %varA% ...
0
votes
2answers
50 views

CMD doesn't update environment variables even when restarting the OS

I've been setup my variables for my development environment using the Windows cmd, but it works well only the first time I set them with the System>Advanced>Env Vars dialog. I just restart cmd and it ...
2
votes
1answer
7k views

TEMP environment variable occasionally set incorrectly

Occasionally, I find my TEMP and TMP environment variables set to C:\Windows\TEMP. They should be set to %USERPROFILE%\AppData\Local\Temp, and are configured correctly in System Properties. This ...
0
votes
0answers
4 views

Display variable for headless machine to avoid display errors

I'm running some Python programs on a compute cluster. A package I'm using is still in development and isn't very friendly for real work environments...such as the use of: import matplotlib.pyplot ...
1
vote
2answers
31 views

What's the Ideal Way to Swap Entries in the $PATH environment variable?

In Linux and/or Mac OSX, what is the best way to automate moving an entry in the $PATH environment variable to the front of the value like this: /foo/bar:/one/two/three:/opt/local/bin:/home/user/bin ...
6
votes
1answer
12k views

Set Permanent Environmental Variable in Windows XP

I want to set environmental variables permanently through a batch file. Is there a command to set Permanent Environmental Variable (other than SETX) for Windows XP service pack 3? command SETX ...
5
votes
3answers
5k views

Refresh environment variable

How can I refresh a Windows cmd shell after I modified my Environment variables? i.e. in bash I can just do "source ~/.bashrc"
0
votes
1answer
37 views

How to access Java JARs through CLASSPATH environment variable on Windows 7

I know there is this article on JAR files on Linux but the solution involves some Linux specific commands I don't know, and ultimately I'd like to understand if I can access my JAR (and JARs it ...
0
votes
1answer
248 views

How can I run a command as a different user while Fedora boots up?

I have a server which runs Fedora 19. When the server boots up, I need to run bunch of commands. I do this in /etc/rc.d/rc.local file. This works well. Now I need to start my nodejs server from this ...
2
votes
2answers
2k views

sudo, runuser, su don't work as I expect when run as root with command as “echo $HOME”

When I run these commands it outputs as shown. /root $ sudo -u someuser -i "echo $HOME" /root $ runuser -l someuser -c "echo $HOME" /root $ su - someuser -c "echo $HOME" /root What i expected ...
-1
votes
1answer
25 views

Export windows Environment variables to a file. [duplicate]

Can we write a batch file to export all or some environment variables to a file in windos 7?
0
votes
1answer
222 views

How to a sudo command which keeps all environment variables

Example command is as follows, run as a normal user which python /home/me/env/development/python because the PATH environment contains a path that points out to this instance of python (instead to ...
1
vote
1answer
25 views

How does a process change the environment variable of its parent process?

Take cd as an example. Also, it is cd that reminds me of this question. When we input "cd" and press enter on a terminal, a cd child process of the terminal starts and in my mind all things about cd ...
6
votes
1answer
52 views

How to determine whether a folder in %PATH% is required in Windows 7

How can I determine whether a particular folder in the PATH environment variable is used by the system? Recently, some software that relied on the system PATH stopped working b/c another package ...
36
votes
3answers
45k views

Is there a list of Windows special directories/shortcuts (like %TEMP%)?

I'm looking for a reference list of shortcuts like %TEMP%. When I'm using Windows+R or Windows Explorer and type %temp%, the Windows Explorer takes me to the Temp directory. Are there more of these ...
-1
votes
1answer
51 views

alternatives to insecure sudo?

How do I protect my environment from sudo erasing half of it? It seems I can protect variables, but functions that the variables (like the prompt, for example) rely on are undefined. This means that ...
0
votes
2answers
74 views

Inform the User when a specific file updates or changes (SOLVED)

The other day I tried to make a batch file that will tell the user the Contest of a file when a specific text file updates/changes here's my code so far it doesn't work for some reason :S @echo ...
0
votes
0answers
8 views

Is it possible to set environment variables in a DE-agnostic manner in X11?

For an example, to set environment variables in Xfce4, I would copy /etc/xdg/xfce4/ to .config/xfce4/xinitrc and add export BLAHBLAH="xyz" in there, but that won't work on Gnome, or KDE, or LXDM, or ...
1
vote
3answers
3k views

Term Enviroment Variable not set, when executing a Bash File via SSH

i am trying to run a bash script on a remote machine. If I open a ssh connection in a terminal, i can easily run the script. But when i run it like that: ssh user@ip < /etc/script I get an ...
0
votes
1answer
443 views

Set enviroment variable setx

I am setting a environment variable with setx(win7) in a cmd , that I started from a batch file, if I close the shell an open a new from batch file again and use Set command to check it, I do not get ...
0
votes
0answers
33 views

Inno Setup ChangeEnvironment not working

I am using InnoSetup to create an installer but the Environment is not refreshed after the installation. The user has to restart the computer in order for the Environmental Variable to be refreshed. ...
66
votes
6answers
3k views

Choosing between .bashrc, .profile, .bash_profile, etc [duplicate]

This is embarrassing, but after many years of using POSIX systems full time, I still have a hard time figuring out if a shell customization should go in .bashrc, .profile, or somewhere else. Not to ...
1
vote
1answer
97 views

Where is file that saves Environment Variables?

I am a developer and usually do stuff with the PATH variable. However, now there are too much path in it, and using a short textbox of Windows is a pain. Before I happen to jump into a text file, ...
0
votes
0answers
16 views

path setting appears twice in env output

After an OS version upgrade I have the following strange problem: % port MacPorts 2.3.1 ... % sudo -i # port MacPorts 2.3.1 % sudo port sudo: port: command not found Furthermore, if I do it all ...
0
votes
2answers
7k views

How do I add an environment variable so I can run an EXE from any folder in the Windows command line?

I went to Environment Variables in the Advanced tab of System Properties and added a new System variable like this: name: msbuild35 value: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe but ...
1
vote
1answer
38 views

Batch script to take the output of a command and create a variable out of it?

For example, I want to search for a file where /r C:\ "myfile.txt" and then make the output of that command which would be the file path to "myfile.txt" a variable I choose, So then the path to ...
141
votes
7answers
161k views

What are PATH and other environment variables, and how can I set or use them?

Questions about setting environment variables the PATH are very common here, and in most cases the answers are very similar to each other. In the future it would be nice to have a good Q/A for ...
0
votes
2answers
66 views

Accidently deleted PATH environment variable - how do I get it back? [duplicate]

I had to add the JDK path in the system variables which is under environment variables, but by mistake I deleted the default path which was present in the Path and pasted the JDK path. So how do I ...
7
votes
5answers
5k views

Setting environment variables in OS X for GUI applications

How does one set up environment variables in Mac OS X such that they are available for GUI applications without using ~/.MacOSX/environment.plist or Login Hooks (since these are deprecated)?