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
0 answers
19 views

Environment variables such as PATH not visible in processes started as service

I have randomly bumped into this as I can clearly see that PATH variable is not populated in the process that I'm now starting as a service on Windows 11, while the same exact script when started from ...
Roman Yankin's user avatar
0 votes
2 answers
79 views

How to safely store environmental variables and make it actually invisible in my PC?

I am learning about environmental variables. I know for example that if I have a secret password I should not code it inside of my code. From what I understood is that a .env file should be used to ...
Federico Gentile's user avatar
3 votes
1 answer
152 views

LANGUAGE environment variable ignores `en` (English)

On my Linux systems, I prefer the user interface to be in English. However, as a native speaker of German, I need spell checking to understand both English and German. Yesterday I've learned that you ...
scy's user avatar
  • 358
0 votes
0 answers
95 views

Using Jdk1.8 and installing openjdk 11

I had a working java 8 application in my windows asset until I installed jdk11 using Ubuntu package. Now when I give java -version cmd in Ubuntu I get the openjdk 11 version: $ java -version openjdk ...
user avatar
0 votes
2 answers
153 views

How to backup the environment variable configuration for windows 10?

The situation is as follows: Windows 10 22H2 (referred to as System A for short) cannot start (installed on hard drive A), nor can it enter safe mode or other startup modes, as starting will result in ...
S-N's user avatar
  • 103
0 votes
2 answers
68 views

How many environment variables does Windows 11 allow?

I have quite many environment variables scattered both in User Variables and System variables, and I cannot add more variables, which leads me to a question: is there an upper limit on the number of ...
coderodde's user avatar
  • 105
0 votes
0 answers
20 views

Mac's sudo not sanitize PATH from user's setting?

Mac's sudo behaviour is unlike everywhere else, of which just like observed in Passing PATH through sudo, sudo would flush PATH every time. However, I found in Mac, my PATH setting is carried into ...
xpt's user avatar
  • 8,651
0 votes
0 answers
15 views

Character limit Trying to modify the system PATH variable after already entered the long path in register give error msg [duplicate]

Getting this error in windows 10 64 bit I did enable to enter long size path from the registry My question is how to disable this character limitation ? I most say that this limitation is happening ...
user71020's user avatar
  • 607
1 vote
0 answers
162 views

How do I set env variables for Docker on Windows desktop?

I'm trying to set up Sabnzbd and this is what I'm attempting to set: I am getting this message: s6-linux-init: warning: unable to dump kernel environment to /run/s6/container_environment: Is a ...
ErocM's user avatar
  • 173
4 votes
2 answers
255 views

How do I persist windows variables set in a CMD file?

in windows I would like to have a cmd script that I can run which sets an environment variable. The variable should still be set after the script executes. The variable is a token of sorts and is ...
George's user avatar
  • 181
0 votes
0 answers
101 views

Set proxy on login if proxy server is reachable

I have to move between work, where we have a firewall and have to connect to the internet through a proxy and home where I do not need a proxy. Since there are no global proxy settings in Linux and a ...
Oskar's user avatar
  • 101
0 votes
1 answer
110 views

How many environment variables can be passed through openssh SendEnv/AcceptEnv

I have added SendEnv whatever_* in ~/.ssh/config on the local host and AcceptEnv LANG LC_* whatever_* in /etc/ssh/sshd_config on the remote host. Now, I'm trying to run some stuff on the remote ...
Bogdan Prădatu's user avatar
2 votes
0 answers
208 views

VSCode unable to sign commits

If I try to commit something, I'm getting this error. > git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S error: gpg failed to sign the data: gpg: skipped <redacted&...
MathIsNice1729's user avatar
0 votes
0 answers
44 views

Windows cmd won't recognize changed PATH

Few days ago I installed Tesseract OCR by installing Capture2Text via Chocolatey. This proved not to work, and instead of uninstalling Capture2Text I went ahead and deleted the Capture2Text folder ...
Elizabeth V.'s user avatar
2 votes
0 answers
258 views

My PATH environment variable got lost during an installation this morning Windows 11

I noticed that commands weren't working in my command prompt. I tried rebooting but still the same problem. Eventually after looking in this forum, I found out that my PATH variable was effectively ...
dacfer's user avatar
  • 155
0 votes
0 answers
34 views

Why does echo $(TZ=GMT+17 date +%Y%m%d%H%M%S) show me yesterday?

When I run this command today, November 8, 2023 at 1100 GMT, the output is: 20231107180000: echo $(TZ=GMT+17 date +%Y%m%d%H%M%S) I would have thought that, if anything, GMT+17 would ADD 17 hours to ...
mscher's user avatar
  • 1
0 votes
1 answer
1k views

Why is 'kubectl' is not recognized as an internal or external command on WIndows?

I edited env variables by pointing to kubectl and helm(after downloading them and storing into kube folder) when I go for kubectl in cmd,I got 'kubectl' is not recognized as an internal or external ...
Richard Rublev's user avatar
0 votes
0 answers
55 views

Permissions on specific subfolders with Set-Acl

I have to create a set of folders based on an address list and then configure the permissions in active directory. Creating the folders and subfolders works for me, I adapted a few lines I found ...
Marin's user avatar
  • 1
0 votes
1 answer
180 views

Node wont run from cmd unless the .exe extension is added

So this is a very weird one. Let me start by saying that things used to work fine. I installed Node a few days ago and once complete I opened a command prompt (On Windows 10), I entered node --version ...
Jacques Ramsden's user avatar
0 votes
1 answer
899 views

How to verify if a variable is equal to an other variable or a Windows variable in batch files?

I am making a "locked" batch file that only certain user can use so what I am doing right now is to check the condition if what the user write is == to %username% or other variable like this:...
NTF espolion 307's user avatar
0 votes
1 answer
922 views

Where to set env var for Debian12?

There are too many places can hold permanent env var settings in Linux, so that I can't finger out which one is the most correct/proper. /etc/environments /etc/bash.bashrc /etc/profile /etc/profile.d/...
Leon's user avatar
  • 239
1 vote
0 answers
64 views

Launch docker container from power shell fail, unexpected behavior?

I have created the following script in powershell for two objectives: read from an .env file the setup of the local urls of my development environment and deploy them to the Windows hosts file. take ...
Francisco Nuñez IA Lover's user avatar
0 votes
0 answers
116 views

Shell-agnostic method to set environment variables

Open your favorite search engine and key in "linux environment variable" and you will get thousands of results that say the way to set environment variables is to use export or add them to ~/...
AwesomeCronk's user avatar
0 votes
0 answers
26 views

prefix commands linux c++ application

I have a C++ application in linux. I run it application arg1 arg2 When I run ps -eaf I see it with the paramters. The problem is when I run it with prefix flag: PREFIX_FLAG application arg1, arg2 ...
user avatar
0 votes
0 answers
79 views

Why does adding a filetype to PATHEXT cause invocations to say "Access is denied"?

My goal: to run a file hello.py on my %PATH% when I write hello. What I've done: Made sure .py is part of PATHEXT. C:\Windows\System32>echo %PATHEXT% .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;....
GreenTriangle's user avatar
2 votes
2 answers
7k views

How to add an environment variable to a container in Docker Desktop?

On my first use of Docker Desktop on my Mac, I pulled MySQL from search bar (for Docker Hub presumably), and hit Run. A dialog appeared asking me for configuration options such as port number. I ...
Basil Bourque's user avatar
-2 votes
2 answers
196 views

How to use CD command in Windows Terminal with custom environment variables?

If I create a environment variable, I can use it with Win+R and enter %MyVariable%. The directory opens in Windows Explorer. However, if I try to do the following using Windows Terminal cd %MyVariable%...
iamveryfriendly's user avatar
0 votes
0 answers
149 views

Setting PATH for whole user session

I need to add a path from my home folder to the PATH variable for the entire user session. I am running a Plasma session under Wayland on the Steam Deck. Using $HOME/.config/environment.d/***.conf to ...
sonofevil's user avatar
  • 107
1 vote
1 answer
633 views

XDG Base Directory environment variables not respected by notionally compliant software

The goal I'm running Arch Linux. I want to store all config/data/cache/state files in subdirectories of ~/local, like so: ~ ├── downloads ├── documents └── local ├── data ├── state ├── ...
theo's user avatar
  • 336
0 votes
0 answers
23 views

pipe text stream to eval in terminal

So I have a bunch of environment variables I am getting from netlify where I store them and I pipe them into an .env.local file, and then when I start my process it reads that .env.local file, but ...
user254694's user avatar
  • 1,135
1 vote
1 answer
64 views

Cygwin Bash doesn't inherit all CMD's environment variables

If I enter echo %AppData% in a CMD window, I get C:\Users\User.Name\AppData\Roaming. If I enter echo $AppData in a Cygwin Bash shell, I get nothing. However, most environment variables in CMD do get ...
user2153235's user avatar
  • 1,171
1 vote
1 answer
164 views

tmux %if %else %endif syntax misbehaving when using a String Comparison statement on a format variable invoked on .tmux.conf

I am trying to achieve the functionality of be able to understand when a certain Window in 'tmux' is above or below 10. So I have used the following on my ~/.tmux.conf, which I am sourcing from ...
freddie_ventura's user avatar
3 votes
1 answer
2k views

how to move ssh-key related files to another directory?

i've been trying to clean up my root directory so that it isn't clustered with random dotfiles. nonetheless, on setting up the ssh-key i came to a dead-end, where i wouldn't find a way to migrate ...
Lanny's user avatar
  • 33
-1 votes
1 answer
224 views

Set Variable to ls command output

I'd like to create a variable from the output of a bash command. How does one create a variable out of the output of the command "ls /Users". Variable creation does not work in this case: ...
Sam's user avatar
  • 11
3 votes
1 answer
446 views

What is this variable "RlsSvcPort" in my System environment variable?

I was checking my environment variables to make some dev-related changes and found this: What can it be?
Am33d's user avatar
  • 133
1 vote
1 answer
63 views

Bash terminals launched from windows UI have an invalid `!::=::\` variable set

When I run printenv one of the returned variables is !::=::\. I noticed that the variable exists because docker does not work correctly with it set. $ printenv | grep :: !::=::\ $ docker stack deploy ...
anderio Moga's user avatar
0 votes
0 answers
111 views

Putting Short SHA in ENV in dockerfile, when built from Quay build trigger

I'd like to access the Short SHA (from latest GitHub commit) via an ENV variable inside my Dockerfile. But, my build is kicked off by a Quay build trigger, so it doesn't appear I can use an ARG. Is ...
Dan's user avatar
  • 101
1 vote
0 answers
257 views

What is the difference between different options for 'ls' colored output in zsh?

I want to display colored output for the 'ls' command in the terminal for my MAC but I do not understand the differences between some of the methods. On some articles and reddit posts I saw people ...
Ravi C's user avatar
  • 11
0 votes
2 answers
86 views

BATCH: Correctly interpret environment variables passed by user through set /p

I want to support variable comprehension from user input in my script. >set target=%programdata% >echo %target% Gives me: C:\ProgramData All well and good, however... >set /p target= >%...
Luke Faez's user avatar
1 vote
1 answer
389 views

Expand variable to alias and execute

I have an alias set in my .bash_aliases file to execute neovim. I can successfully use this alias from the command line however I cannot use this alias via a variable (ie the EDITOR variable - set in ....
ljden's user avatar
  • 113
0 votes
0 answers
59 views

I have an issue with printing paths from environment variables in windows 11

So I tried to install javabridge for a project that I have with Weka. By doing this I discovered that I can not print the paths from environment variables when I tried to create a CLASSPATH and ...
Παύλος Μηντσόπουλος's user avatar
0 votes
0 answers
13 views

How can I access the edit environment variables window? [duplicate]

I can't seem to access the edit environment variable editor, I instead get the edit system variable editor when I click on edit. Looking at the other questions, I maybe deleted the original path when ...
Tyuskwo's user avatar
-2 votes
1 answer
176 views

Override System Environment Variables syntax in Windows

I know that the syntax for expanding system Environment Variables on Windows is %VAR%. I just wondered -out of curiosity- if there were a way to override this in any manner. So entering e.g. @var (or ....
dba's user avatar
  • 97
0 votes
1 answer
477 views

How can I set a file located in the Roaming Folder as an Environment Variable? [duplicate]

I have installed Jupyter on my Windows. The jupyter.exe command looks like stored in C:\Users\XXXX\AppData\Roaming\Python\Python310\Scripts. C:\Users\XXXX\AppData\Roaming\Python\Python310\Scripts>...
Jordy's user avatar
  • 101
2 votes
0 answers
119 views

Running android avdmanager with sudo

I am running avdmanager create avd from my python script that I start with sudo -E to make my script be able to do priveldged stuff. But for some reason avdmanager created AVD inside /root/.android/...
Euler-Maskerony's user avatar
0 votes
0 answers
112 views

Docker nginx image optional tls option

I need to create a nginx docker image, which can be used to configure optional TLS/SSL certificates. When no certificate is provided, nginx should work as reverse proxy on port 80 and do its job. If a ...
Marc's user avatar
  • 331
0 votes
1 answer
464 views

Powershell: Use a string as multiple args

I have a string variable in PowerShell, $t="foo bar" and it should be passed as argument to command 'start-process'. My 'start-process' needs multiple args which is "foo" and "...
Dan D.'s user avatar
  • 701
0 votes
0 answers
20 views

How to trace back PATH of executable in Windows? [duplicate]

In Windows, you can set PATH to specify which executables you can invoke without the need to specify their path. How can you trace back where Windows found the executable? Example 1: Let's say you ...
Matt's user avatar
  • 384
0 votes
0 answers
180 views

do i need to have [%systemroot%\system32] also when [%systemroot%] already is present in path?

Is there a need to also have [%systemroot%*system32*] or is that path already "covered" by [%systemroot%] ?
TiVoLi's user avatar
  • 1
0 votes
2 answers
1k views

How do I pass an argument from Windows Batch to single Powershell Command?

I know I can pass variables to a powershell script like this: powershell -file ".\filetorun.ps1" "arg1" "arg2" and put param(var1=args[0],var2=args[1]) in the Powershell ...
HTWingNut's user avatar
  • 499

1
2 3 4 5
26