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

3
votes
1answer
13 views

In bash, declare an alias that depends on current variable content

I would like to declare an alias in my .bash_profile that will use the content of a variable when the alias is used and not when it is declared. Ex: alias goSomeWhere="cd $BASE/somewhere" When ...
0
votes
1answer
11 views

Java Path Set Issue

I am using win server 2008, Trying to set java path. I set it in both user variables and system variables. yet, I couldn't access java. But when I check in java installed path It is working fine ...
2
votes
2answers
12 views

2 java versions and unable to change environment variable

I am working on Mac OS 10.9 I did not know that macs come with java by default. So I installed my own java(version- 1.8.0_20) Now here is the confusion - I have a java in the following locations - ...
0
votes
1answer
14 views

Git is in the PATH, but is not being recognized as a command

I've recently reinstalled Git, and I just can't get it to run off the native Windows command prompt anymore. I'm sure it is in Path environment variable, as you can see: C:\Users\Ult>where git ...
2
votes
1answer
14 views

Call “Environment variables” dialog from Win-r

In Windows, if one presses Win-r, and types there, e.g. control the control panel opens. Is there a Win-r shortcut for environment variables dialog?
0
votes
1answer
19 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 ...
0
votes
1answer
22 views

Is there a way to “source” a sh script from the fish shell?

I like to put many of my environment variable definitions in the .profile script. If I am using a POSIX-compatible interactive shell like bash, I can use the source command to re-export the ...
0
votes
1answer
33 views

Windows Environment Variables

I am very confused on what is incorrect with my Windows Path variable. In my System Settings I have the System Variable Path set to: ...
1
vote
0answers
14 views

user path not merged with system path

On my Windows 7 machine, for some reason the user path is not merged with the system path variable when I start a new command prompt. I have seen other related questions answered by a reference to a ...
0
votes
0answers
33 views

ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type “SETX /?” for usage

I am trying to set my environment variable for my system using setx PATH="%PATH%;c:\PROGRA~2\Vim\vim74;" command in cmd. I get ERROR: Invalid syntax. Default option is not allowed more than '2' ...
1
vote
1answer
38 views

Are there rules to Windows 7 Environment variable names?

On my Windows 7 computer, I created some custom user environment variables (right-click computer > properties > "Advanced system settings" > "Environment Variables..." > "New..." for "User variables ...
1
vote
1answer
28 views

Installing Cygwin with MinGW in windows

I wanted to install Cygwin in the C:\Cygwin (which is shown by default during installation). I have the C:\MinGW installed in that directory too(I mean C:\) Will this cause any problem when I install ...
0
votes
1answer
26 views

.tmux.conf: How can I conditionally set a color variable?

Sometimes I use a light-colored terminal, sometimes a dark one. I export a THEME environment variable to conditionally set colors in my .bash_profile and .vimrc. I'm trying to do the same in my ...
0
votes
2answers
53 views

How to configure AUCTeX in Windows 7?

Help me, please! This is my 3rd attempt at a clean install of EMACS/AUCTeX in Windows 7. I'm following Joachim Schlosser's installation guide to AUCTeX but I'm getting confused at least on 2 points. ...
0
votes
0answers
13 views

How to tell whether machine is on AD Domain when running as SYSTEM

I have a batch script run as the SYSTEM user, and I need to find out whether the machine is on an AD Domain or not. I don't know, or need to know, the AD Domain name, just whether it's on any AD ...
0
votes
1answer
22 views

Is there a way to reverse lookup which executable is being called?

I have multiple JDK's installed on my machine and I'm running on a system that has a pretty long path environment variable. Is there a way to see what my call to java resolves to? I'm looking for ...
1
vote
1answer
26 views

Add the path of a program to environment variables and have it as Command Line commands

I use gpj tool to communicate with my smart card reader. It works fine. For example when I want to list the applets that reside on my card I use parameter -list and I have the below out put : E:\RCII ...
0
votes
1answer
22 views

is it possible to allow only root user to create Environment variable?

We know , Linux world right now watching on Bash bug with environment variables. So , I just want to know If we can make something like only root user can create environment variables and all other ...
1
vote
1answer
38 views

Unable to find source of environment variable

So I did the mistake of removing an earlier version of Vim manually on Windows without going through the "Uninstall Program" dialog. The result left me with the enviroment variables of "vim" and ...
0
votes
0answers
24 views

Windows open command window here doesn't load env. variables

In windows if I right click and select "Open command window here" in a particular folder it works exactly the same way as "Open terminal here" works in Linux. It was working find until I installed a ...
1
vote
2answers
30 views

Different Execution the TEMP Variable and TMP in run window

Why does the environment variable "TEMP" work without a percent Sign in Run window, but "TMP" variable doesn't work? I know the "TMP" Variable works with "%TMP%" in Run window. This is my Environment ...
0
votes
0answers
26 views

Clean Mavericks Install: Bash and Environment Defaults?

Broadly: what are the default files in play on a clean OS X install when using environment variables and bash? What derives from root, and what from the local user? I always get turned around on ...
0
votes
0answers
16 views

Why am I getting conflicting results when checking Maven version in Windows PowerShell and cmd64 (Environment variables issue)

I'm looking at Maven for the first time, trying to get everything up and running. I've been going through the tutorials here and up until now everything has been going smoothly. I've added all the ...
0
votes
1answer
39 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
44 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 ...
0
votes
1answer
55 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
64 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 ...
0
votes
2answers
62 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 ...
0
votes
1answer
38 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 ...
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 ...
1
vote
0answers
39 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 ...
0
votes
1answer
32 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
101 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 ...
0
votes
0answers
6 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
votes
1answer
27 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?
1
vote
2answers
32 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 ...
1
vote
1answer
43 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 ...
0
votes
1answer
65 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 ...
-1
votes
1answer
56 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
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 ...
0
votes
0answers
80 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 ...
0
votes
0answers
22 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
100 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 ...
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 ...
6
votes
1answer
55 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 ...
1
vote
1answer
20 views

Why does 'export foo=1' not get read when I use ssh?

I'm trying to set a remote environment variable explicitly in an ssh command: ssh worker-2 "export OPENBLAS_NUM_THREADS=1; echo $OPENBLAS_NUM_THREADS" Strangely, this prints just a blank line, but ...
0
votes
0answers
23 views

enviroment variable %PROGRAMFILES% with 2 executions

I want to install a program with a batch-file to the Program Files folder. Afterwards I want to copy a folder to the same folder. Here is an example: SET SCRIPT_LOCATION=%~dp0 SET ...
0
votes
1answer
28 views

crontab and binaries in /usr/local/bin

I am working in Redhat and have few programs located in folder /usr/local/bin I would like to call from crontab for root user. I thought that by putting binaries in that folder would be sufficient to ...
0
votes
0answers
31 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.