Questions tagged [environment-variables]

For questions pertaining to environment variables, a set of dynamic variables that can affect the running processes behavior and access to resources. Use this tag for questions about environment variables or questions about issues arising from the impact of setting or modifying the variables value in running processes behavior and access to resources.

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

What files set the default PATH

I'm puzzled as to what files set the default PATH on Linux (specifically, Debian). (I'm not interested in the user-specific ones in ~ (.profile, xsessionrc, maybe others) here.) So far I've ruled out ...
0
votes
1answer
48 views

Changing PATH Variable in zsh

I want to change my PATH variable in zsh. Problem: I don't understand where in the .zshrc file I have to make modifications. Normally, I would look for the assignment to the PATH variable and set the ...
1
vote
0answers
35 views

How to set options in systemd unit?

Just learning about creating custom systemd unit and currently im feel kinda stuck. [Unit] Description=Simple service After=network.target [Service] Type=simple WorkingDirectory=/ ExecStart=/bin/bash ...
1
vote
0answers
62 views

How do I change my $EDITOR variable if it refuses to change?

I'm running Manjaro Linux in the KDE Plasma desktop environment. I'd like to be able to use the classic C-X C-E command to run Vim from a terminal emulator running Bash on the GUI desktop. However, ...
1
vote
1answer
39 views

bash variable expansion not working as expected

Everything looks right, and pasting the "echo" output into the aws command works as expected. However, when using the variables on the command line, aws complains about an unclosed ...
0
votes
1answer
31 views

openSUSE Tumbleweed: How do I get sudo crontab -u root -e to open the root crontab in nano instead of vi?

Just wondering the above. So far I've tried: export EDITOR=$(which nano) export SUDO_EDITOR=$(which nano) export VISUAL=$(which nano) in both ~/.bashrc and /root/.bashrc, as well as Defaults ...
1
vote
0answers
20 views

python virtualenv activation in bashrc causes environment variables to be overwritten

I have a virtual environment which I usually activate by default in my bashrc via source ~/.venv/env/bin/activate. This has been working fine on an old MacBook Air and Linux Desktops and servers (I ...
0
votes
1answer
15 views

KDE Autostart Missing Library

I'm trying to debug an issue with a SH script in my KDE autostart directory (~/.kde/Autostart). I'm running Scientific Linux 6.4 (kernel 2.6.32-754). The script simply launches an application. This ...
1
vote
1answer
40 views

Do I need to wrap in quotes user names and groups?

According to systemd's enforced User/Group Name Syntax, the set of one is defined by the exact same rules as for POSIX, i.e. «lower and upper case ASCII letters, digits, period, underscore, and hyphen»...
5
votes
2answers
927 views

Can it possibly work if I assign two shells to SHELL in cron?

Recently I started the process of gradual switching my shell to nu and because of it I thought about assigning its path to SHELL in cron. Having read a good part of the manual at man 5 crontab, I took ...
0
votes
0answers
9 views

How can I run a shell script that exports env vars for graphical applications under Gnome3/Wayland

I've read this but it's quite old, and even the more recent things I've found Wayland was still brand new as the default. What I'm really trying to do is run nvm.sh, in my home directory, which ...
-1
votes
0answers
46 views

“Illegal variable name” error while I'm trying to install and configure Docker on FreeBSD

I'm a new freebsd user,I'm looking inside the Freebsd ecosystem for the tools that usually I use in Linux. At the moment I'm trying to install and configure docker and I found this tutorial : https://...
0
votes
1answer
27 views

How to update given environment variable values in json

I need to use the below json file as input and this file could contain multiple variable entries. I need to search var1 or var2 in environment variables and replace the value in below json. { "...
0
votes
1answer
45 views

Bash array which contains environment variables to be used as function arguments

I am trying to store some function parameters in a bash array, but some of them are defined from the content of environment variables and they do not actually "expand" to their actual values ...
0
votes
2answers
50 views

Set an environment variable per user shell independent [duplicate]

How can I set an permanent environment variable per user independent from the used shell (bash, zsh and fish)?
0
votes
2answers
192 views

Check if environment variable is set from the command line

I want to know if a particular environment variable is set or not, from the command line. I need to distinguish between it being set to a blank string (or just whitespace) and not set at all, so I'd ...
0
votes
1answer
113 views

Run a Bash Script from Python and import the exported environment variables into Python

I have the following Bash script called Test_Vars.sh #!/bin/bash #----------------------------------------------------# # Environment Variables being used in the process # #------------------------...
0
votes
2answers
47 views

How to get the default DISPLAY variable?

When creating a new shell session, the DISPLAY variable is set accordingly (it can be :0, :1, localhost:0, etc.). If I accidentally messed up the DISPLAY variable, usually I want it reset to this ...
0
votes
1answer
37 views

Global Variables across scripts [duplicate]

Why is lets say HOME recognized by all my scripts but my variable DMENU isn't? I export it in my bspwmrc file which is executed at start up.Also had it in my zshrc. Why do this? DMENU="-h 27 -z ...
-1
votes
1answer
57 views

The command could not be located

I found this whenever I open a terminal window. Can someone find a permanent solution of this? bash: /usr/lib/jvm/jdk-16.0.1: Is a directory Command 'dircolors' is available in the following places * ...
-1
votes
1answer
43 views

updata variable content

i'm editing network mount point script file. When the variable is assembed, it contains information, but when it is unmounted it appears empty, and if the script asks to assemble, the content of the ...
0
votes
2answers
53 views

Which process does the $PATH environment variable belong to? [closed]

Environment variables must belong to a process, right? It seems that there are de facto "global" environment variables like $PATH and $HOME. Which process do they belong to?
0
votes
0answers
36 views

set or pass an environment variable to a snap application (reach pulseaudio server on another machine via tcp from within a snap application)

dear power users and devolopers, i am encountering some problems, adjusting to the way snap works. i always embraced all the possibilities that a GNU/Linux distribution offers me. however, i feel that ...
0
votes
0answers
17 views

Systemd file for gunicorn. share dynamic OS environment variables before launching workers

I have a flask app running on Ubuntu, using gunicorn with 12 sync workers. I have an environment file .env in which I set some secrets in the wsgi. I get those secrets through an API, but that API has ...
0
votes
1answer
61 views

Script with Crontab runs VLC Video Without Sound

I have set up a testing script to play videos on VLC-3.0.12 (Manjaro) using crontab (cronie-1.5.7). The file in question looks like this: #!/bin/bash ## YES, I'M RICKROLLING MYSELF FOR TESTING [[ &...
3
votes
1answer
43 views

less doesn't page the output when called inside env

After an update I noticed that my bash profile for man colorization breaks paging. I don't know what changed but I narrowed it down to the fact that calling env less hello.txt results in contents of ...
0
votes
1answer
49 views

Why is my variable available through echo, but not through printenv?

When first installing powerlevel10k, one usually follows the guides available on the Internet and clone the repository inside oh-my-zsh's folder: git clone --depth=1 https://github.com/romkatv/...
0
votes
2answers
37 views

How to automatically update the $http_proxy variable system wide on network connection?

Sometimes I need to tether from my phone. Problem is when I do it uses a random private IP as the network gateway. And Google seems to think they own your phone, not you, so I don't have much control ...
0
votes
1answer
42 views

sudo crontab notify-send doesn't work

I have read similar posts here, here, here and here that mentioned some environment variables DISPLAY and DBUS_SESSION_BUS_ADDRESS. Setting them at the top of my user crontab enabled notify-send to ...
0
votes
1answer
33 views

ZSH Environment variables

What is the difference between these two lines: export XDG_CONFIG_HOME="$HOME/.config" export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc" And these two lines: export ...
1
vote
2answers
84 views

This command: “. .bashrc” has resulted in: “-bash: /usr/bin/whoami: Argument list too long” whenever I try to execute any command

While following instructions at a forum post to install something over ssh at an external machine, I executed the following command without thinking: . .bashrc I have never seen the command before ...
0
votes
2answers
54 views

Environment variables in Fish

I need to use a program called Kpax, the "installation" process consist in this: (for bash users, edit ~/.bashrc) export KPAX_ROOT=/home/dritchie/kpax <- substitute the proper ...
1
vote
0answers
25 views

Where do I export gnome-keyring-daemon's ssh agent socket so that it is available at launch of WM?

I use gnome-keyring to manage my ssh keys. In order for that to work, I must set $SSH_AUTH_SOCK accordingly, which is prodived by gnome-keyring-daemon -s. For use in shells, I can easily do this in my ...
2
votes
1answer
184 views

How do you set an environment variable for the current session in an rpm?

I am producing an rpm for Sia in ClearOS7 (based on Centos7) and have hit a brick wall. I am trying to set SIA_DATA_DIR=/var/lib/siad-data for the session where I am installing the rpm. It is needed ...
1
vote
0answers
42 views

tmux doesn't inherit PATH variable when inside docker?

I am trying to run tmux inside docker container. It runs but looses variables like PATH, for example inside container: root@sparkmaster:/opt/bitnami/spark# ls /opt/bitnami/python/bin/python /opt/...
0
votes
1answer
46 views

GNU Make exports macro as environment variable only when it's already present

Consider the following Makefile: X = macro-X-value foo: echo $$X $(X) The intention here is to use X both as a name of an environment variable and of a macro. When using bmake, it works as ...
1
vote
0answers
51 views

Cannot change directory (cd) or use Working Directory Systemd Exec commands

I am trying to get a startup script (systemd service) for docker-compose containers. I am struggling to get it working, and have made changes and changes; with some things working, and other things ...
2
votes
1answer
32 views

Why do I get an error when using cd as env's utility argument? [duplicate]

I'm studying the env command and trying to understand how it works. Here's the command synopsis: env [-iv] [-P altpath] [-S string] [-u name] [name=value ...] [utility [argument ...]] I decided to ...
0
votes
1answer
67 views

zsh function to export multiple variables from clipboard clipboard

I want to be able to take the contents of the clipbard and evaluate it in zsh without showing the contents of the clipboard export FOO=BAR export BAR=BIZ export BAZ=FOO I've tried function aws-eval-...
0
votes
0answers
19 views

Starting service returns 'Failed to start'

I'm running node-red on the raspberry pi. And a service configured to start a ffmpeg stream to twich.tv. When I try to start the service form the command line(ssh) it works like a charm. But when I ...
0
votes
1answer
2k views

bash: shutdown: command not found

I installed the latest version of Debian (netinstall). I have the problem, that the terminal does not know commands like shutdown, reboot, and so on. When I do whereis shutdown it tells me it is in /...
0
votes
2answers
63 views

Sharing environment variables between zsh and bourne shell (for crontab)

I set JAVA_HOME in .zshrc: export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ which is fine for interactive programs. But I have JVM programs running via cron, which uses Bourne shell. The ...
2
votes
1answer
139 views

What characters are valid in environment variable names

Which characters may occur in an environment variable name, not considering any shell limitations?
0
votes
1answer
51 views

Linux - Check If a Variable is a Shell Variable or User Variable?

I have defined a variable by writing VAR1='abcd' into .bashrc file. I could list the all variables by using compgen -v command. I could check if any variable from this output by using printenv or echo ...
1
vote
1answer
47 views

Linux - Get List of Local-User-System Environment Variables Separately

I could get system environment variables by using printenv command, but I need separate variables data: How could I lists of get local (session-wide), user (user-wide) and system (system-wide, global) ...
1
vote
1answer
81 views

Is unsetting environment variables always cause some fallback behavior?

Regarding Bourne shell and derivates, I understand IFS to be a behavior program for field splitting (commanding how to split fields into "words") which is needed for a broader process named &...
5
votes
1answer
742 views

When defining an environment variable, I get “Command not found”

When I type HELLO="hello", I would expect to create an environment variable called HELLO. Instead, I get the error HELLO=hello: Command not found. What could be going wrong here? I am on ...
0
votes
0answers
35 views

Missing .bashrc but reference exists to the missing .bashrc

I added some contents in .bash_profile. I messed up by adding some paths to $PATH. After logging out and logging back in, I was not able to find .bashrc or .bash_profile. But when I echo $PATH or ...
0
votes
0answers
45 views

How to audit access to environmental variables?

I need to know which programs accessed them and when.
1
vote
2answers
115 views

How to define variable globally

I've setup ssh-agent as a systemd service on my Manjaro (following directions from here). Along with the service itself, the SSH_AUTH_SOCK environment variable needs to be set to ${XDG_RUNTIME_DIR}/...

1
2 3 4 5
27