Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [environment-variables]

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 ...

15
votes
1answer
3k views

I changed my “HOME” variable and now cannot find “~/.bash_profile” to change it back

I was messing around with environment variables on my Mac, trying to learn how to use them and I used the command nano ~/.bash_profile where I then added the line HOME=/Users/MyCompName/Desktop to ...
0
votes
0answers
23 views

changing the environment to start a software

I have downloaded a software and want to change the environment of my computer such that when I write the name of the software, the downloaded software opens. The download directory is: /home/abc/...
0
votes
1answer
44 views

Editing System Environment Variables is allowed only when opened through Control Panel

On Windows 10, if I open the Environment Variables window directly through Windows Search, I can't edit the System Variables (buttons are disabled): However, opening it through Control Panel (Control ...
0
votes
0answers
12 views

Problems Setting Environment Variable on Ubuntu | Ruby on Rails

I have tried to set my environment variables multiple ways on my Ubuntu server but nothing seems to work. I need to know how to properly set them on the digital ocean droplet I am using to host my ...
0
votes
0answers
32 views

Command prompt. Is it possible to create a certain number of variables according to the lines in a text file and then

Can we use a text file to set variables according to how many changing lines are there in the .txt file? files.txt name 1 text 2 info 3 ... and so on set line01="name 1" set line02="text 2" ...
0
votes
1answer
7 views

Setenv list edit Centos 5.11

Been looking for an answer but nothing seems to give me a simple one-liner answer (I am not a computer genius). I want to edit one of the variables (I see them with setenv commant) on a centos 5.11 ...
0
votes
0answers
19 views

How to command line `cd` into directory on other drive by using Environment Variable? [duplicate]

I want to use Windows CMD or PS I want to execute this command: C:\Users\myusername>cd %MYSPECIALENV% In System Variables MYSPECIALENV variable points to D:\SomeDir\SomeOtherDir (Other Drive!) I ...
0
votes
0answers
6 views

Using ENV vars in IntelliJ IDEA

I'm using IntelliJ IDEA in Windows 10. I'm trying to set up an application-specific login credential set without hard-coding it into a YAML file. This project will eventually be pushed to github and ...
0
votes
1answer
35 views

How to set Base64 encryption key as Environment (system) Variable on Windows 10

I have an application that connects to BigQuery using multiple creds from .json file. Being that this app will eventually reside on Pivotal Cloud Foundry and will need to be set as User Provided ...
1
vote
1answer
64 views

The function of the %configsetroot% system variable in Windows

When I checked my PC, the %configsetroot% system variable was set to the path: %SystemRoot%\ConfigSetRoot But the weird thing is that the directory as indicated by that path doesn't exist. The ...
0
votes
0answers
14 views

Batch script is unable to read Windows environment variables if windows agent is running over SSH from linux master Jenkins

I have setup Jenkins master on linux, and agent on windows 7 using SSH. But when my jenkins job is invoking batch scripts present on windows agent, it's unable to get %LOCALAPPDATA%, %USERPROFILE% and ...
0
votes
0answers
14 views

Add environment variable to internet explorer shortcut

As seen in the image below, I would like %username% to be replaced with the username of that current computer user. Is such a thing possible? If not would it be possible with a bash script somehow?
1
vote
1answer
16 views

How can I store a Powershell variable's value as a string while creating ISE submenus

I can't seem to articulate my issue well enough within the search engines to find the answer I'm looking for, so I turn to the community for help: I want to populate my Powershell ISE's menu with ...
33
votes
5answers
3k views

Does the Windows Command Prompt search somewhere other than those locations specified by the PATH variable when launching application programs?

I tried the following experiment. Before I start, I checked the PATH variable from cmd, which has the following value: Path=C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS ...
0
votes
0answers
21 views

Unable to use environment variables in setting other environment variables in Windows 10

In the environment variable window in Windows 10, I set FOO_VAR=foo BAR_VAR=%FOO_VAR%bar I would expect that echo %BAR_VAR% shows "foobar" but %FOO_VAR% in BAR_VAR doesn't get resolved. Is this ...
0
votes
0answers
74 views

Switch-user causes change of TEMP variable of the exprorer.exe

I have Windows 7 Pro x64 with latest patches. Though it may sound unbelievable, sometimes, the environment variables TEMP and TMP of my explorer.exe process - seemingly out of nothing - change their ...
0
votes
1answer
54 views

Environment variables only work if I launch the application from terminal

I recently got a MacBook and I'm doing some programming with Eclipse. I need to use Amazon S3, so I needed to set my credentials as environment variables. I typed vim ~/bash_profile and added the ...
0
votes
1answer
96 views

Search and replace environment variable's value via batch file?

I want to create a batch file to quickly switch a PATH variable in order to be able to work in a different environment, and then another to restore it. I assume that it would be done via setx and some ...
0
votes
1answer
33 views

if -else in shell script, matching argument with string

For the following shell script - #!/bin/sh main_version=0 feature_version=0 patch_version=0 if [[ $1 -eq "m" ]]; then main_version=$((main_version+1)) fi if [[ $1 -eq "f" ]]; then ...
0
votes
1answer
12 views

How to use variable in variable in bash?

I have two variables - regex="<version>[0-9]*\.[0-9]*\.[0-9]*[^<]*<\/version>" updated_regex="<version>${main_version}\.${feature_version}\.${patch_version}${tag}<\/version&...
0
votes
1answer
27 views

Want to set an environment variable with TIME /t

I want to set a Windows environment variable from the results of TIME /t. In Windows, the %time% variable yields one format (13:17:52.79), whereas TIME /t has another (01:17 PM). I've tried ...
0
votes
1answer
34 views

Create Percentage Sign Variable to use in Environment Variables

In Windows 10, some environment variables actually use percentage signs to refer to paths. For example, the PSModulePath environment variable looks like this (ignore the additional one I marked out): ...
2
votes
2answers
365 views

Set PSModulePath Environment Variable with PowerShell in Windows 10

I don't understand this. So currently my system environment variable named "PSModulePath" looks like this: %ProgramFiles%\WindowsPowerShell\Modules;%SystemRoot%\system32\WindowsPowerShell\v1.0\...
1
vote
1answer
41 views

Unix/Linux - service unit file cannot recognize env variable set in /etc/environment

I have an environment variable setup correctly in /etc/environment I have ensured that it loads correctly via /etc/profile modification. and I can echo it to confirm. but when I created the unit ...
0
votes
0answers
759 views

Windows 10 environment variable PATH not getting updated

Inspired by the following video link : https://www.youtube.com/watch?v=JQ58d3BEV_8 I tried to change the PATH variable of my system and add the path that has been mentioned there . Ii have a ...
0
votes
1answer
87 views

pip command error during installation of requirements.txt

When I run the command py -2.7 -m pip install requirements.txt, I'm getting the error but I have already upgraded it but I'm still getting error in installing requirements.txt. When I use the ...
1
vote
1answer
1k views

Setting an environment variable in Windows 10: gPodder

I have just installed the podcast client gPodder (https://gpodder.github.io/). I am trying to change the default download directory, and the manual indicates that you set the environment variable ...
0
votes
0answers
123 views

Registering an Application to Custom URI Scheme with environment variable

I'm following the guide here on Microsoft's site to register an application to a custom URI scheme. This works if I can provide a static path to the executable to run shell open command ...
0
votes
0answers
20 views

Where does $HOME variable comes from and why I can't change it? [duplicate]

I know this is stupid, but last 30 minutes I am trying to change $HOME variable to other value, doing $Env:HOME = "desired value" did nothing for me, I tried couple other suggestions from the first 10 ...
1
vote
1answer
29 views

Add ~/projects/*/bin directory in environment PATH (Ubuntu 16.04)

Everything is in the title. I know how to add new path in the environment PATH variable but I would like to make it recursive by automatically adding /bin folders of all my future projects. Something ...
1
vote
1answer
91 views

Batch file not returning correct value after using bat to exe

I'm having lots of issues with this script. It's supposed to read the a file (that the user specifies) then save it to the storeresult environment variable. I'm using a BAT To EXE converter that ...
2
votes
0answers
121 views

Globally set environment variables for gpg-agent in MacOS High Sierra

I want to use gpg-agent instead of ssh-agent in MacOS High Sierra. To achieve this I need to set globally two environment variables: GPG_TTY=$(tty) SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh This ...
0
votes
0answers
40 views

How to get values, log into server and run commands using PuTTY with the values

I am trying to create an automated (batch) script (i.e., for Windows) to collect hostname and instance name (SID), open PuTTY using my username/password & host to login into the server and issue ...
0
votes
1answer
66 views

How to override environment path variable to call curl from custom path instead of system32 path?

I have a path for folder containing curl.exe file (C:\My\Custom\Directory\) added to Path Environment Variable. The problem is that when I call curl from command line, it runs another curl executable ...
0
votes
2answers
53 views

automatically setting an environmental variable before invoking GUI app

I have a windows GUI app, say prog.exe, which is located in a folder in the system path. The app is not mine, and all I have is binary, so I can't change the program. I have a file type, say *.typ, ...
0
votes
0answers
125 views

What/Where/How is the proper place to configure the PATH environment variable in zsh?

The official zsh manual seems to recommend that you configure the PATH environment variable in zshenv: http://zsh.sourceforge.net/Intro/intro_3.html `.zshenv' is sourced on all invocations of the ...
0
votes
1answer
180 views

How to set/Change default $PATH value for all users?

How to set/change the default $PATH environment variable to be $PATH/root for all users at the same time ?
0
votes
2answers
50 views

How to pass the variable of the result of find command to dd

I'm trying to transfer CentOS.iso file to a USB flash drive using dd command by passing a variable which is a result of find command. I want to pass variable like this dd if=$isofile of=/dev/sdb ...
0
votes
3answers
168 views

how to use output as VARIABLE and put trimmed value into CLIP?

can anyone teach me the right way? here is my attempt code: @echo off SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION "%~dp0..\x64\mediainfo.exe" --Inform=General;%%UniqueID/String%% "%~dp0..\files\...
0
votes
0answers
52 views

Does squid support variables (or similar) to indicate external acl path?

Does squid.conf support variables to indicate external acl path? Problem: I need to replace the path to my lists (which are many) by a variable or something similar, for when I want to change the ...
0
votes
0answers
49 views

AWS ElasticBeanstalk (Python) Environment Variables disappear after being set

So I am experiencing a funny problem. I am using ElasticBeanstalk on AWS, and I have several Applications initialized along with their corresponding Environments. In the past I have been able to ...
0
votes
2answers
56 views

Trying to use an environment variable in a .cmd script, getting the message “\Windows was unexpected at this time”

I need to access a windows environment variable in a .cmd script, it looks something like this, following the documentation on microsoft's support: if "%MY_ENV_VAR%" == "" ( echo You must set your ...
0
votes
1answer
670 views

how to set $HOME variable so that cmd find the path

Regardless of what directory I am at, for instance, when type in cd ~/Documents/project in git bash, it works. Whereas, it will not work doing the same in the cmd. It says: the system cannot find the ...
0
votes
1answer
135 views

How to copy environment variables from local shell to a remote ssh connection inside a shellscript?

I am currently working on a shell script that is used to build docker images and restart containers running on the remote host. below is the stripped down version of the code. #!/bin/bash -xe # ...
1
vote
0answers
44 views

Finding where an env variable is set

I have the problem that my http_proxy is wrongly set, whenever I start a new terminal: » echo $http_proxy http://http://127.0.0.1:1234/ Which is ... bad. I have a bug somewhere in my environment ...
1
vote
1answer
73 views

How to allow users to execute a script without revealing protected information

Given that the root user has some credentials (say, an API key) set in an environment variable, and given an unprivileged user John, how can I let John execute a script that uses said API key without ...
0
votes
1answer
318 views

User32.Lib inclusion

I'm trying to compile a Windows version of Chromium. I followed the guidelines mentioned here and I'm getting an error at the last part, when running the following command: gn gen out/Default After ...
1
vote
2answers
686 views

Setting variable in /etc/environment has no effect

I have the following in my /etc/environment: http_proxy=http://myproxy.net:12345 After rebooting the machine, I login and check the variable: root@d6c44fa03243:/# echo $http_proxy (empty) Why is ...
1
vote
3answers
153 views

Split variable in 2 after the last dot

I need to cut variables in two smaller variables after the last dot. For example the variable "european.union" will be vara=european and varb=union I use the following code to accomplish this purpose:...
0
votes
0answers
56 views

Using %userprofile% vs \\server\profile\user

I am currently in the process of deploying DWG TrueView on Windows Server 2012 R2 which is used as a terminal server. Since the users don't have any admin rights I need to set some registry keys to ...