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

1
vote
2answers
32 views

Passing environment variables to remote server as a different user

I'm trying to set environmental variables while I SSH into a remote server on a CentOS server. I am running the command as root but need it to run a command as the Oracle user. I found a few things on ...
2
votes
1answer
622 views

What prompt is sh using when you type sh into Terminal?

When using the default PS1 prompt that MAC OS/Terminal comes with, when you type sh you get a new style prompt. station-4:~ user$ sh sh-3.2$ When you export your own PS1, this functionality goes ...
5
votes
1answer
36 views

Is it safe to edit the global PATH environment variable?

I just recently found out that I couldn't run mysql without typing out the whole path or being in the correct directory--unless I added the path to the PATH environment variable. I managed to do so ...
1
vote
4answers
2k views

Win7: messed up system - set too long path variable

I just messed up my Windows 7 Enterprise 64-bit. I tried to install CMake - and during installation i got an error saying something like it can't set the path variable, because it is too long (I can'...
39
votes
4answers
3k views

Difference between “a=b” and “export a=b” in bash

What's the difference between: a=b and export a=b In bash? I understand that they both define environment variables, but I don't fully understand the difference.
1
vote
2answers
3k views

Environment Variable ORACLE_UNQNAME not defined

I'm trying to install Oracle 11gR2 Entreprise Edition but during database creation, I got this Error : Environment Variable ORACLE_UNQNAME not defined And when I tried to lunch 'emctl.bat' From ...
1
vote
1answer
28 views

Call sourced file's functions in bash script

I have a bash file, src-useful.bash, containing useful functions such as say_hello(),located in /path/to/useful. In my ~/.bash_profile I added the following lines: export BASH_USEFUL=/path/to/useful ...
0
votes
3answers
39 views

Start a program in Windows as it is run in a clean system

Is it a way to start a program in Windows as it is run in a clean system (without any software or libraries installed)? I can do something like set PATH= but it is not sufficient as I can see. E.g. ...
1
vote
1answer
19 views

Adding ffmpeg as environment variable

I've been trying to follow step two of the dependence guide of Microsofts Project Malmo. https://github.com/Microsoft/malmo/blob/master/doc/install_windows.md I need to create the environment ...
2
votes
2answers
10k 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
1answer
2k 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 ...
8
votes
8answers
58k views

Spaces and Parenthesis in windows PATH variable screws up batch files

So, my path variable (System->Adv Settings->Env Vars->System->PATH) is set to: C:\Python26\Lib\site-packages\PyQt4\bin; %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; %SYSTEMROOT%\...
0
votes
2answers
73 views

set environment variable from batch

When I set a environment variable envir using setx command, It seems to not actually 'set' in environment. setx envir "windows" if 1==1 ( setx envir "unix" ) echo %envir% set The set command ...
1
vote
1answer
3k views

How to fix $PATH environment on Mac OS X?

Recently, I tried to install ruby and I somewhat messed up with variable environment. As a result, I am not be able to use paths in .profile or any other path files that I set up before (I tried in ....
4
votes
1answer
10k 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 ...
-1
votes
1answer
32 views

delete file-process with powershell using environment variables

I have adapted a powershell script, to delete a file in specific path, but first i must close the process generated by this file, but it has errors (does not recognize route with the environment ...
1
vote
2answers
39 views

Notepad++ - search for same things that are in line twice

I would like to know if there is way to search file for two things in same line. For example if I want to search line with "variable >=" and "variable >=". Problem is that I dont know what "variable" ...
13
votes
2answers
805 views

In Windows Explorer, why can we create a folder or file with the percent symbol, if the percent symbol is reserved for variables?

Go to Windows Explorer, and create a folder named %systemdrive%. Now, open a command prompt, and try to go to the folder you just created. You can't, because there are percent symbols in the folder ...
3
votes
4answers
23k views

How can I refresh my PATH variable from the registry, without a reboot, logoff, or restarting explorer?

I've made some changes to the %PATH% variable in the registry. Now, I'd like to see those changes applied without having to go so far as a logoff, reboot, or reload of Explorer. Is there a way this ...
3
votes
2answers
2k views

What does // and :: in the values of environment variables mean?

On my Linux machine some of the environment variables contain lists of directories. The directories are separated by :. But sometimes they are separated by ::. Is it just a mistake that should be ...
2
votes
1answer
25 views

Passing variables into ssh sessions (Session has to stay alive)

is it possible to start a ssh remote session and pass a variable to the remote host, which is usable in the opened session. For Example: Client: testvar="this is my text" Open ssh session (ssh user@...
0
votes
1answer
44 views

How can I set a modified PATH for a non-interactive non-login POSIX shell invoked by Scons on Cygwin?

Because I work on a number of separate projects, (each of which uses a different compiler), I don't like to have the path to any one compiler set in my PATH. Now I have joined another project where ...
2
votes
0answers
22 views

DISPLAY environment variable is always 0

I have two monitors attached to the same desktop computer. However, when I do echo $DISPLAY, it prints :0.0 on both screens. Shouldn't echo $DIPLAY print :0.1 from one of the screens?
1
vote
1answer
229 views

Why does Windows have a limit on environment variables at all?

What the Technical Reasons for 1024 character limit After having used Linux for the past 3 years, so many Windows 7 Pro issues have been bothering me at my day job. The most inane are the filename ...
4
votes
2answers
956 views

How to remove a path from $PATH variable in fish?

I am using fish as my shell in Debian and recently (after some upgrade) whenever I try to use command completion I have: set: No such file or directory set: Could not add component /usr/lib/x86_64-...
0
votes
1answer
22 views

Change target of shebang

I would like to create the target python3 to be used in shebangs. Eg. use the first line #!/usr/bin/env python3. What I tried: setenv python3 PATH_TO_BINARY, also put it into .cshrc, echo $python3 ...
0
votes
1answer
32 views

Centos: there is no ~/.cache/upstart

I'm new with linux.As I know ~/.cache/upstart is folder where system processes log their stuff. But I can't find this folder in Centos. What I'm most curious about is that on Ubuntu this folder ...
0
votes
0answers
18 views

OpenSSH won't resolve %temp% environment variable in commands and batch files

I installed OpenSSH on my Windows Server 2012 R2 system. So far everything works except for resolving the %temp% environment variable: In my PuTTy SSH client I can resolve %systemroot% but not %...
2
votes
1answer
199 views

Export bash function over SSH

I would like to export a bash function over ssh to use it in GNU parallel. That question seems to be answered here Exporting bash functions through ssh but I don't seem to be able to get it to work. ...
85
votes
4answers
54k views

Windows 7's PATH and environment variables are corrupted

I have no clue, but lately I've been having this problem. After running my workstation suddenly something destroys PATH and lots of stuff stops working. Initially, my path had MANY directories listed (...
0
votes
0answers
17 views

Git installs to a network drive

I'm using Git at work (on Windows 8), but we have a variable in AD called 'HomeDrive', which is annoyingly set to a network drive. Git has decided to install the git bash and other utilities here, ...
0
votes
1answer
52 views

How to handle variable in Batch script nested loop?

the following batch work well until the comment "the following do not perform as expected" I've try any kind of %; %%, ! around the variables but always fail, either do not have any thing or errors! ...
37
votes
4answers
69k views

How do I make sudo preserve my environment variables?

Using sudo 1.7.4p4 on Solaris 5.10 and sudo 1.6.7p5 on RHEL4 u6 I can't see how to preserve my environment variables, for instance $PYTHONPATH. I've added this line to sudoers, but it doesn't make any ...
11
votes
2answers
9k views

Suppressing the “Picked up _JAVA_OPTIONS” message

I'm using _JAVA_OPTIONS to set some defaults for Java on RHEL. It works fine but now every time I start java I get the following message Picked up _JAVA_OPTIONS: -foo -bar -baz is it possible to ...
98
votes
5answers
105k views

Change environment variables as standard user

When clicking on "Advanced system settings", I need to login as the administrator and hence only edit the administrators environment variables (in addition to the machine wide ones). How do I edit the ...
0
votes
1answer
43 views

Does Windows7(+) have the env or equivalent? (Env. variable for single run of application) [duplicate]

I'm looking for an opportunity to launch an application (eg, compilers) with specific environment variables . I want same functionality like env in Linux. env var=value application.exe I found ...
0
votes
1answer
82 views

Is there an environment variable for C:\Users\%USERNAME%\AppData\Local\Temp in Windows 7?

Is there an environment variable that by default points to C:\Users\%USERNAME%\AppData\Temp in Windows 7? Or maybe C:\Users\%USERNAME%\AppData\local\Temp for that matter? Also what are these ...
0
votes
1answer
23 views

Why does Software use it's own proxy settings?

Why does some software on Linux e.g. wget and apt-get/aptitude don't make use of the system variables for proxys? Is the difference between all the system too large to do that or is it just because ...
2
votes
2answers
996 views

environment variable for hkey_users/software

Many of my software configurations are stored in theHKEY_USERS\S-1-5-21-2715202203-4090495733-1863141328-1000\Software reg-folder. For developing Portable apps, I want to know the environment variable ...
225
votes
4answers
303k 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
1answer
28 views

Is there a way to modify/set an environment variable for one session? (Windows 7)

I am looking for a way to temporarily change the user-specific PATH variable in Windows 7 in such a way that it resets when the user logs off. Preferably I would like to accomplish this in a batch ...
0
votes
1answer
108 views

Intel(R) Management Engine Components\DAL in envoirement variable

Here is my path variable C:\Users\hzhao\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update2\bin; C:\Users\hzhao\.dnx\bin; C:\Program Files\Common Files\Microsoft Shared\Windows Live; C:\Program Files (...
0
votes
1answer
94 views

What is the difference between DESKTOP_SESSION, XDG_SESSION_DESKTOP, and XDG_CURRENT_DESKTOP?

I want to detect which desktop manager I am running, and I found out that there are three environment variables, DESKTOP_SESSION , XDG_SESSION_DESKTOP , and XDG_CURRENT_DESKTOP which could help me do ...
0
votes
0answers
23 views

bash: illegal character in an environment variable

According to man bash, bash identifiers may consist: "only of alphanumeric characters and underscores", however, bash seems to have been tolerant to this up until shellshock patch. Actually, it still ...
20
votes
2answers
9k views

What is the difference between SETX and SET in environment variables in windows

What is the difference between SETX and SET? As per my understanding: Both are used to set environment variables SETX is for user variables. SET is for shell variables.
4
votes
2answers
27k views

Recover accidentally deleted Path environment variable

I use a Windows 7 x64. I just accidentally deleted my user path environment variable and was trying to recover it. I'm glad I found what I really need here. But I don't understand what exactly "...
1
vote
2answers
40 views

Using setx to append to user PATH

My attempt: setx PATH "%PATH%;%~dp0" How do I do this without everything in system PATH getting duplicated in user PATH?
0
votes
1answer
11 views

proper way to set IRCSERVER env environment variable?

the IRC BitchX guide says two conflicting things: earlier, when describe all the env vars: IRCSERVER - Server(s) separated by spaces to use, in the format irc.host.com:port[:password] Then ...
0
votes
1answer
22 views

Can rsync use a remote environment variable?

Say I want to use rsync to copy a remote folder to my local desktop: rsync -av remote:$REMOTEDATA $LOCALDATA But I want to access the $REMOTEDATA environment variable on the remote server, not the ...
0
votes
2answers
70 views

CMD not recognizing javac.exe

On my Windows 7 64 bits, I changed the JAVA_HOME variable to point on 64 bits JRE, and changed it again to point on 64 bits JDK. I did same operation a few times. Every time I do this change I close ...