Skip to main content

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
1 answer
50 views

%localappdata% and echo %localappdata% returns two different directories [closed]

I'm having some issues with Windows 10. After fixing my temp INET folder which somehow was pointing at a different account, I've now found an odd issue. If I type echo %localappdata% in CMD, it gives ...
user3714877's user avatar
0 votes
0 answers
39 views

Possible to expand/use a variable value, in another variable, in a systemd service file?

All I want to do, is to re-use the name I enter in the User= specification in a systemd .service file; e.g. I would have liked to do this in a .service file: # ... User=my-username Environment="...
sdbbs's user avatar
  • 1,392
1 vote
0 answers
57 views

Does Windows 11 have a 32,767 character limit for environment variables?

(See also: Why does Windows have a limit on environment variables at all?) According to the Windows app development documentation, “The maximum size of a user-defined environment variable is 32,767 ...
Ginger Jesus's user avatar
0 votes
0 answers
29 views

Does ~/.gnupg/gpg.conf accept shell environment variables?

I need to add my GPG key to some lines in ~/.gnupg/gpg.conf such as default-key XXX default-recipient XXX Does it accept shell environment variables? Can I use default-key $GPGKEY default-recipient $...
Computist's user avatar
  • 2,967
-2 votes
1 answer
37 views

In there some description of all the command processor macros in Windows?

I'm looking for a list of the macro strings known to Window 10 command processor, e.g. %ProgramFiles%, %ProgramFiles(x86)%, etc.
Max Yaffe's user avatar
  • 147
0 votes
0 answers
53 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
981 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
203 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 won't contribute anymore's user avatar
0 votes
0 answers
206 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
1 vote
2 answers
469 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
  • 113
0 votes
2 answers
100 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
27 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,801
0 votes
0 answers
16 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
288 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
396 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
165 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
196 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
338 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
47 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
475 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
51 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
2k 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
65 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
1 vote
1 answer
345 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
2k 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
2k 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
7 votes
1 answer
2k views

An entry in my system env variables 'IGCCSVC_DB' has a base 64 string as a value, any idea what its purpose might be?

On Windows 11, what is the purpose of IGGCCSVC_DB in my environment variables? I'm assuming this is the Intel Graphics Command Center Service (IGGCCSVC). DB means database. The IGGCCSVC_DB string ...
sc_top22's user avatar
1 vote
0 answers
73 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
148 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
28 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
111 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
3 votes
2 answers
12k 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
279 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
178 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
  • 127
1 vote
1 answer
888 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
25 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,165
1 vote
1 answer
84 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,201
1 vote
1 answer
235 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
391 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
551 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
65 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
1 vote
0 answers
351 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
212 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
535 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
76 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
-2 votes
1 answer
233 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
568 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
134 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
1 answer
715 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
  • 731

1
2 3 4 5
26