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 scripts (they just have to update the environment variable).

Filter by
Sorted by
Tagged with
0
votes
0answers
24 views

This PATH Variable is apparently invalid, not sure how to remedy it

In the process of fixing my Java PATH variables for development, I was recommended this Windows app called Rapid Environment Editor, which seems to be pretty dope indeed. I was able to fix my invalid ...
0
votes
1answer
34 views

sudo: sorry, you are not allowed to set the following environment variables

I set an alias for sudo as: alias sudo='sudo PATH=$MY_PATH' I checked that this works well by running sudo printenv PATH. However, I encounter an error when running sudo su - USER2. sudo: sorry, you ...
0
votes
1answer
25 views

SHELL=“/bin/bash” vs SHELL=“bash”

What's the difference between exporting SHELL="/bin/bash" and SHELL="bash"? I previously had export SHELL="bash" in my .bashrc. It seemed to work. $($SHELL) spawned a ...
0
votes
0answers
28 views

How to set the PATH variable with .zshrc

I am trying to compile a program using Intel C and Fortran compilers (icc and ifort) on my Mac (Big Sur 11.2). Both icc and ifort executables are located in /opt/intel/oneapi/compiler/2021.2.0/mac/bin....
0
votes
0answers
13 views

how to configure java ENV variable in Azure App Services java11 tomcat 9 stack

I have a java-11 tomcat-9 stack app service. I want to setup xmx (max heap memory) to that. How can I set that? Sidepoints I went to ssh and tried printenv | grep JAVA but I could not find anything. ...
0
votes
0answers
14 views

.bash_profile is not sourced when logging in via a display manager

I read this question, in particular the fact that display managers do not set up a login environment. So, the .bash_profile file is not sourced when I log into my system (via gdm). I do not really ...
0
votes
0answers
15 views

Is it possible for system environment variables to resolve references to user environment variables on Windows?

I would like to be able to store cached data in a uniform location. In order to do this, I have defined an environment variable %CACHE_DATA_PATH%. In my system environment variables, I have given it ...
1
vote
3answers
101 views

Ubuntu: Environment variables set in .bashrc but not being used in cron?

I have set some environ varibales in .bashrc but they end up as None when the script is run by cron. When I run it using python3 it works perfectly. Set the variables: nano .bashrc .bashrc export NBB=...
0
votes
0answers
24 views

Best way share Windows PATH variables for program installed as a user, when I sometimes want to run as an admin

I have git for windows installed on my Windows 10 machine. I installed this using my user account, and as such it is installed in a location in the app data folder, with a path like C:\Users\user.name\...
1
vote
3answers
69 views

How to add a single executable from a certain directory to PATH environmental variable?

I was looking for a way to add only one specific executable file from a certain directory to the PATH environmental variable. Instead of adding the whole directory C:\Program Files\Firefox Beta I ...
0
votes
0answers
21 views

Changing the installation path of brew script in CentOS 7

I am trying to install brew using the following script: $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" However, I get the following error: ...
3
votes
3answers
74 views

How to display each location of Windows PATH on a separate line using the GUI

I don't know what changed about my settings, but recently the dialog box under Advanced System Settings -> Environmental Variables -> System Variables -> select Path -> Edit is not showing ...
0
votes
0answers
19 views

Set environment variable with '%' in the value

I want to save a value as an environment variable to latter use in some code. My problem is that the value has the percentage sign ('%') in it and I believe Windows read it as an identifier for other ...
1
vote
1answer
26 views

Save Windows variable until logoff, shutdown etc

Using Windows (e.g. 10 but I hope it doesn't matter), is there any kind of environment variable whose life ends with the user session in which the variable was created? I'm talking about something a ...
0
votes
0answers
60 views

Debian GNU/Linux (LXDE): How can I change the XDG_DATA_DIRS environmental variable permanently if ~/.xsessionrc doesn't work?

I am currently running the Debian testing branch (bullseye at the time of writing) and I already created and confirmed the functionality of an .xsessionrc file for the purposes of changing the PATH ...
1
vote
1answer
32 views

How to I persist prepended items to PATH in fish shell?

My PATH Prefixes Don't Persist I'm using Fish v3.2.0. According to the documentation, set -U fish_user_paths should persistently ensure that the directories stored in it should be looked up before ...
0
votes
2answers
52 views

Accidentally deleted a System variable

So I wanted to add python to my system variables and it didn't work so I deleted the variable and accidentally deleted another one too. I don't know which one it is tho. I do have an open console with ...
0
votes
1answer
39 views

Sed special characters in variable '&'

Sorry, easy question, but I can't find how to do it: I have a special char "&" in a Variables that I have to use in sed. Example: #The template .env cat .env MY_SECRET = VAR_MY_SECRET ...
0
votes
0answers
51 views

How to find Windows environment variables from hard drive without booting?

How can I find what the PATH variable on Windows 10 was on a backup "image" of an old system hard drive? I returned my computer to field support, they "backed it up", restored it ...
1
vote
0answers
26 views

Windows 10 nested environmental variables not working in Windows Explorer

I have an environmental variable called STEAM pointing to my Steam installation and a variable SSE pointing to a game installed inside it. As you can see, the path gets correctly expanded in the ...
1
vote
0answers
20 views

%PATH% contains unresolved variables when connecting to OpenSSH Server on Windows 10

I'm running OpenSSH Server on Windows 10. When I log in from another machine via SSH, the PATH contains unresolved variables. If I have a variable MYPATH defined as MYPATH="C:\MyHome", then ...
1
vote
0answers
18 views

How do I add modules to PYTHONPATH variable for zenmap in Kali Linux [duplicate]

I installed zenmap in my Kali Linux but when tried to run it, the terminal gave me the following error telling me to add modules to the PYTHONPATH variable. ┌──(root💀kali)-[/home/kali/Downloads] └─# ...
0
votes
1answer
38 views

SOLVED: why does my windows 10 user path show fully duplicated values from system path?

My windows 10 user path variable only has the entry %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin I have put all other path settings into the system path variable. If I open a command ...
0
votes
1answer
32 views

environment variable in scripts with heredoc

script: t1.sh DEST=`mktemp -d` echo "DEST=$DEST" script: t2.sh sudo -s <<EOF DEST=`mktemp -d` echo "DEST=$DEST" EOF invoking t1.sh, with or without sudo: $ bash t1.sh DEST=/...
0
votes
0answers
14 views

How to audit the event of setting PSExecutionPolicyPreference?

The main problem is that we execute PowerShell scripts and one of our machines changes the Execution Policy during execution for reasons unknown. Goal is to figure out when and why this change happens....
1
vote
0answers
24 views

How to hide an API Key on heroku for an Angular app

I have the frontend part of a project using Angular and I am trying to find out how to properly hide an API key in a production environment (Heroku). There are two variables I need to change between ...
0
votes
1answer
105 views

Windows 10 - I want to set environment variable for D drive

This is what I mean by "I set up the environment variable for d drive I am using windows 10 and I have installed Kafka in D drive. So when I set up the environment variable for d drive it does ...
0
votes
1answer
34 views

How do I set environment variable by importing from a file?

I know set command sets environment variables temporarily while set command sets environment variables permanently. This command exports current environment variable path to a file echo %path% > ...
0
votes
1answer
59 views

How to use environment variables in a powershell pipeline?

The command systeminfo | find "System Type" is supposed to return System Type: x64-based PC both in a Command Prompt window and in PowerShell. In my case it says /usr/bin/...
1
vote
1answer
42 views

Can i have a private / user-specific etc folder?

I am often fiddling about with software built from source, which i install in $HOME/.local. To make it run, i have to export various variables such as LD_LIBRARY_PATH. But i do not want to have to ...
1
vote
2answers
69 views

PATHEXT environment variable not working

I want to use gcc on Windows, so someone gave me a MinGW folder. I put the D:\software\MinGW\bin\ folder in my PATH. But when I open a new CMD and type gcc, I get 'gcc' is not recognized as an ...
0
votes
1answer
42 views

`wsl env` gives different result to `wsl` followed by `env`

Inside WSL (i.e. by opening a cmd and then running wsl, or just running wsl straight from the start menu) I have this line at the end of ~/.bashrc: LANG=en_US.UTF-8 While still inside WSL, if I do ...
0
votes
1answer
85 views

how do I run a sudo command and load the environment variables of current logged on user?

I need to run an ssh sudo command. command is as follows: ssh -i keyfile ubuntu@10.65.21.253 'sh -v /opt/dir/script' the script contains the following: sudo -E node some.js the reason I use the -E ...
0
votes
2answers
46 views

Expanded variable inside another expanded variable via

Is there any way to insert one expanded variable into another expanded variable, via variable substitution, within a batch file? For example... Assuming 2 files (fileone.dll and filetwo.dll) in the ...
0
votes
1answer
63 views

Windows 10 User Environment Variable PATH updated but changes not recognized

I want to modify the User Path variable, let's say with "C:\Program Files\Sublime Text 3", which contains subl.exe, so I can use subl in a command prompt. I cannot modify the system ...
0
votes
1answer
276 views

How to set environment variables on MacOS using a GUI?

I'm trying to provide instructions to several people on how to set an environment variable in MacOS. I want the variable to be permanent, not require reboot, and it must work for all gui applications. ...
8
votes
2answers
2k views

Can a process run regardless of any shell?

I'm trying to grasp the concepts of shell and terminal and the exact relation between them from the aspect of OS processes. So I have few questions in that field. Sanity check: As far as I understand,...
0
votes
1answer
60 views

my terminal is not recognizing my flask command after i installed flask

I ran into a problem with the terminal, it didn't recognize my flask command! the whole issue started with WARNING: The script isort is installed in '/Users/bigdad/Library/Python/3.8/bin' which is not ...
0
votes
1answer
45 views

PHP not loading ENV vars set in /etc/sysconfig/httpd

I am running Drupal sites (Apache and PHP), and would like to set some of the values in the settings files to be environment variables. After researching, the proper approach appears to be adding them ...
0
votes
0answers
42 views

How to use Windows environment variable in a Chrome bookmark?

At my place of work, I need to create a URL that my colleagues will bookmark in their Chrome browser. The required document is in a local Windows folder: %LOCALAPPDATA%\CompanyName\settings.html. This ...
0
votes
0answers
27 views

How to track changes of environmental variables in linux?

For the linux file systems there is inotify that helps to track file system events. Is there a similar mechanism to track changes of environmental variables?
1
vote
1answer
81 views

Windows Powershell using python Ping instead of default

I am trying to run a ping using windows powershell, but this is the result: ping google.com Traceback (most recent call last): File "C:\Program Files\Python36\Scripts\ping.py", line 31, in ...
0
votes
1answer
34 views

How to get access to exe file from any folders in windows 10

I downloaded gitlab-runner.exe file and need to share this file for accessories from any place on the disk. So, I created an environment variable, using UI: Also, I created an environment, using CLI: ...
0
votes
1answer
891 views

“Python” working but “Py” is not

I'm on Windows 10 and have Python 3.9.0 installed. The evinronment variables I have for Python are C:\Users\Zimplfy\AppData\Local\Programs\Python\Python39\ and C:\Users\Zimplfy\AppData\Local\Programs\...
2
votes
1answer
732 views

WSL2 Create environment variable for all users

I am using Ubuntu as my preferred Linux distro for WSL2. I want to create an environment variable that persist across all users. I already tried lots of answers and none of them work. They work on a ...
1
vote
1answer
216 views

Environment variable for personal OneDrive account

I have been using the %OneDrive% environment variable with my personal OneDrive account, however I connected my work OneDrive account and %OneDrive% now points to it instead. Is there a OneDrive ...
1
vote
0answers
87 views

Use PATH variables from windows on windows subsystem linux 2

As you can see in the title I want to use the variables in the PATH of my Windows 10 inside Windows Subsystem Linux 2, I've installed node, composer, and Xammp in Windows 10, but when I try to run any ...
0
votes
0answers
68 views

Is there a performance impact by having a lot of folders in the system PATH?

Is it okay to have a lot of folders added to the system PATH (in either Windows or Linux), or is there a performance impact? (while booting, or while opening a terminal, etc.)
0
votes
0answers
48 views

Bash Environment Variables Missing from bashrc, profile, and bash_profile

A while ago I edited the environment variables in my bashrc file. I also added some new ones. Recently, I tried to continue the work I have done. I opened up my bash shell and I can view all my ...
0
votes
1answer
30 views

Set environment variables on ssh session and be kept after logout

I want to understand how can I set some environment variables on a remote session that are kept even after i logout and login again afterwards. So,what i normally do userssh@sshserver:~> export ...

1
2 3 4 5
24