Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [environment-variables]

A set of dynamic variables that can affect the running processes behavior and access to resources.

Filter by
Sorted by
Tagged with
0 votes
2 answers
36 views

Which scripts modify the path envirorment variable?

Which scripts modify the path environment variable? What methods can I use to determine which scripts modify the path environment variable?
Lead Vaxeral's user avatar
2 votes
1 answer
305 views

Environment variable LOGNAME or USER does not correspond to effective user id

I'm running an Ubuntu 20.04.6 LTS server. The server hosts some Virtualbox virtual machines that I backup with a bash script on a daily basis. That works quite fine. The bash script also sends some ...
Matth's user avatar
  • 41
-1 votes
2 answers
89 views

I in linux system I geting many same exported path variable

In my ubuntu system I getting same env variable many times This is the output of echo $PATH | tr ':' '\n' | less command in zsh shell /opt/some/bin <<< /Users/pritam/Developer/system_script /...
Pritam's user avatar
  • 1
1 vote
2 answers
124 views

Concatenate string after grabbing environment variable

I'm trying to concatenate a string with a variable which is in .env file. My .env is this: API_URL=http://localhost:3030 NODE_ENV=development And here is my code: [ ! -f .env ] || export $(grep -v '^#...
sundowatch's user avatar
1 vote
0 answers
74 views

What should I use in instead of ~/.pam_environment (deprecated)?

I used to put user-specific settings like LANGUAGE and PAPERSIZE in ~/.pam_environment, but the manual and the warning emitted on login tells me: Due to problematic security this functionality is ...
anx's user avatar
  • 2,358
0 votes
1 answer
70 views

Trivial pursuit : bash environment variables

I know this works: FNAME="$(basename $LD_PRELOAD)" FNAME="${FNAME%.*}" Can this be expressed in a single line? These are two unsuccessful attempts, thus far: ${$(basename ...
John-L_.'s user avatar
0 votes
0 answers
82 views

Environment variable not set in profile.d script

I created a script /etc/profile.d/mkl_restriction.sh which contains the following line: export MKL_NUM_THREADS=1 When I log in (via ssh if that matters), the variable is not set, but if I run source /...
Kevlar's user avatar
  • 101
2 votes
1 answer
484 views

non-login shell sources $HOME/[.local/]bin to $PATH and I can't find why

OS: Ubuntu Desktop 22.04 I am initially logged in as user carl. I open a shell and echo $0, I get the confirmation that I am in a non-login shell. ("bash", no dash) But when I then echo $...
nocarea's user avatar
  • 23
1 vote
1 answer
235 views

What are the implications of using PROMPT_COMMAND like this?

I would like to insert the return code of the last command in reverse red color and inside brackets ([]) plus a colon (:) just before the bash (PS1) prompt. But, only if the return code is non-zero, i....
FedKad's user avatar
  • 10.7k
0 votes
0 answers
89 views

How to add XAMPP MySQL Path in Ubuntu environment variable?

I'm a new Ubuntu (Kubuntu) user. I migrated from Windows. I want to add MySQL bin path to environment variable on Ubuntu (Kubuntu). How to do it? Please help me!
RPD's user avatar
  • 1
0 votes
0 answers
22 views

How do I modify /etc/environment? [duplicate]

I'm new to Ubuntu and I would like to add a new variable to /etc/environment as part of an installation (as detailed in the question linked below). I have attempted to modify environment by opening ...
Nereus's user avatar
  • 101
1 vote
0 answers
398 views

Changing LS_COLORS in Ubuntu 22.04 works in terminal but not permanently in .bashrc

I am learning linux thoroughly, I have downloaded my first VM with vmware-fusion on my mac m1. I have tried many times to update the .bashrc file but the one thing that is not changing for some reason ...
theMyth's user avatar
  • 111
2 votes
1 answer
181 views

Auto-completion puts back-slash before $ mark, how can I disable it? (ubuntu 22.04)

To access files in a directory from another directory, I often set a variable for that directory. For example (so you can try it your self), export dir1=/usr/local/bin and then type ls $dir1/ ...
Chan Kim's user avatar
  • 2,041
0 votes
0 answers
78 views

X11 appears to be stuck on DISPLAY (:1) affecting nvim yank

My Problem Today I discovered that my "native" display is :1 as seen below: $ who kwilkins :1 2023-11-27 22:13 (:1) This is affecting the ability to yank in nvim. My only hope is ...
Kevin Wilkins's user avatar
0 votes
1 answer
90 views

Alt+F2 doesn't run scripts from a folder added to PATH, but terminal does run it

I used to run scripts using Alt+F2 in Ubuntu 18.04, but they don't run in Ubuntu 22.04. However, they run properly if I run them from the terminal which uses zsh. To modify the PATH variable I opened ...
lee genny's user avatar
0 votes
0 answers
923 views

How to use Environment Module packages in Ubuntu

I have been a while in Fedora and other Linuxes, and I got used to loading "environment modules". For example, in Fedora, I could install both mpich and openmpi (two implementations of the ...
alfC's user avatar
  • 3,634
0 votes
0 answers
92 views

Update PATH Variable in Byobu for root

I would like to add a directory to the $PATH variable for all users, including users who run byobu with sudo byobu. I am running Ubuntu 22.04 LTS on x86_64. The desired path is below. Note the ...
Jacob Quisenberry's user avatar
0 votes
2 answers
62 views

Bash function that checks if string argument is a name of existing (set) or not existing (unset) variable

I would like to write a bash function in Ubuntu 22.04 that works like that Var1=100 is_variable_set "Var1" //Returns 0 (variable exists ie is set) unset Var1 is_variable_set "Var1&...
keldorn's user avatar
  • 93
1 vote
1 answer
52 views

Is it possible to monitor hidden file creation using auditctl? Ubuntu 20.04

I want to monitor creation of hidden files in /home/user. Is it possible to create a rule which triggers when any hidden file created in /home/user folder using auditctl? (* or any other methods?)
newby's user avatar
  • 13
0 votes
1 answer
61 views

Is it possible to use environment variable (e.g. $HOME ) in auditctl ? Ubuntu 20.04

I'm trying to monitor /home/<user>/ folder. I created # auditctl -w $HOME -p rwxa -k home_access rule. But it creates rule only for current user. Is it possible to create such a rule that ...
newby's user avatar
  • 13
1 vote
1 answer
222 views

Which environment variable controls the location of .local directory?

Due to storage space constraints in my home directory, I need to move as much out of there as possible. I have moved caches and configs out by setting the $XDG_CACHE_HOME and $XDG_CONFIG_HOME ...
Joff's user avatar
  • 504
0 votes
0 answers
176 views

rename file with name contains variable part

If i have file name (file_$i.txt). How I can change variable part in the name to be (file_$var.txt) $i >> number of lines in file $var >> content of other file
Amany Abd Elmnem's user avatar
0 votes
1 answer
222 views

Pain with Maven and Java env variables

So I installed Java following this guide as I did many times, and set $JAVA_HOME in /etc/environment, java -version works fine. After that I'm following this guide as I did many times and install ...
Arzybek's user avatar
  • 317
0 votes
1 answer
356 views

source command not working in Ubuntu 20.04, complains about missing directory

I'm trying to reinstall openssl library on Ubuntu 20.04 according to https://docs.openiam.com/docs-4.2.1.3/appendix/2-openssl and I'm stuck at the last step. I have to reload the environment variables,...
user avatar
0 votes
0 answers
32 views

What is the best way to temporarily set an enviornmental varabile?

I'm building a breathalyzer for my computer. If the breathalyzer fails, I want to set an environmental variable to make all instances of the web-browser to open in incognito mode. Im debating whether ...
j0h's user avatar
  • 14.9k
2 votes
1 answer
250 views

Environment configuration not reflected when switching users in Ubuntu 22.04

I have two users named Alice and Sally on my Ubuntu 22.04 system. Alice has configured her environment variables in the .profile file, and they are working correctly for her. However, when Alice ...
Vikram 's user avatar
0 votes
0 answers
1k views

Accessing DISPLAY environment variable in systemd service file

I have a systemd service in user session. When the user logs in, this DISPLAY is set (by the Xserver) and I want to access the DISPLAY environment in the service file. This is my service unit. [...
Vipul Gupta's user avatar
1 vote
0 answers
115 views

DISPLAY environment location in Ubuntu 20.04

In Ubuntu, when the user logs in, then the Xserver starts and it sets the value for the DISPLAY environment variable. I wanted to know the location, like the file from which I can access this DISPLAY ...
Vipul Gupta's user avatar
0 votes
1 answer
652 views

Add permanently environmental variable to Ubuntu

I work with Ubuntu 18.04, and using softwares like: petalinux, Vivado. Each time i want to open vivado for example, I open terminal and type: source /opt/XIlinx/Vivado/2020.2/settings64.sh This is ...
Jonathan's user avatar
-1 votes
2 answers
412 views

Accidentally changed PATH variable and I cant change it back, or use vim etc..help

I know there are many questions like this, but I unfortunately dont know enough about Ubuntu to be able to apply it to my situation. I have all my stuff saved for work on a remote machine, that i ...
Learn4life's user avatar
0 votes
0 answers
2k views

export path to $PATH via shell script

Is there some best practice of adding a path to $PATH via a shell script permanently via a shell script and have it accessible? I believe I have only seen temporary solutions, via export PATH=$PATH:&...
Herbert Qerbert's user avatar
0 votes
0 answers
78 views

~/.bashrc displays entries depending on how it is called

I am trying to export a new directory "foo" to $PATH using a shell script. For now I used a shell script install.sh that exports the path like this: <install.sh> #! /bin/sh echo ...
Herbert Qerbert's user avatar
0 votes
0 answers
42 views

Someone know to do permanent enviroment variables with .env file?

My Problem is, I want to do permanent enviroment variables, but I don't want modify .bashrc or .profile to add export varible=content. Because that I see that is possible with .env file but i do and ...
Jaververde's user avatar
1 vote
0 answers
2k views

Error: no DISPLAY environment variable specified on WSL

Good morning I run Ubuntu using the Windows Subsystem for Linux on a Win11 equipped laptop, I've recently tried to install firefox and open it through the CLI but, whenever i give the firefox command ...
a e's user avatar
  • 11
3 votes
1 answer
1k views

"sudo command" not working, but after sudo su when I enter command is working [duplicate]

My Ubuntu version is Ubuntu 22.04.2 LTS. I have one user (ahmet) and it is member of sudo. I download intellij idea and I want to use its mvn lib for everyone. I edited /etc/bash.bashrc as in this ...
Ahmet Hakan YILDIZ's user avatar
0 votes
1 answer
363 views

What overwrites an alias created by a file in /etc/profile.d? (environment variables)

I executed the following command to create an alias file in CentOS 7.9: echo 'alias ll="ls -alhF --color=auto"' > /etc/profile.d/alias-ll.sh Then once I restarted the shell, "type ...
Tristan's user avatar
  • 103
1 vote
0 answers
104 views

Is there a way to dynamically set global environment variables for all users, daemons, and background processes?

I have been trying to reach out to an external data source and dynamically assign the payload contents to environment variables on each startup. I've gotten this half working by running a script in /...
Switch386's user avatar
  • 111
0 votes
0 answers
650 views

Setting global environment variables dynamically on startup

I have an Ubuntu 18.04 vm which executes a script via /etc/profile.d. The script reaches out to an external data source (azure, in this case), pulls down some json, and converts it into environment ...
Switch386's user avatar
  • 111
3 votes
1 answer
654 views

Firebase private key file as environment variable

I'm very new to Ubuntu and developing a project based on firebase firestore database. Trying to run services on ubuntu server 22.04. I can connect firestore database (in windows I can do this by using ...
newbie's user avatar
  • 151
0 votes
0 answers
636 views

Set LD_LIBRARY_PATH for with symlinks

As per the Ubuntu documentation - the only way to permanently set LD_LIBRARY_PATH is by adding a conf file to /etc/ld.so.conf.d/ If I manually run export LD_LIBRARY_PATH=~/nextcloudapp/squashfs-root/...
Terence Eden's user avatar
  • 1,796
2 votes
1 answer
1k views

Symlink on /usr/local/bin/ not working

Can someone explain why this is not working??? I don't get it. $ echo $PATH /usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games As you can see, I have /usr/local/bin in there. Then the ...
Mariano Martinez Peck's user avatar
2 votes
1 answer
2k views

Using files in /etc/environment.d

I am trying to setup a brand new installation of Ubuntu 22.10. I need to make some environment variables globally available. I have read in the Man pages that the correct way to do this is to provide ...
Jonathan's user avatar
  • 1,300
1 vote
1 answer
1k views

Cannot use ibus on applications

I'm trying to install ibus. I changed my environment variable XMODIFIERS to ibus, then I log out and login, the variable still the old one, its doesn't change. I tried unset it and export it again but ...
nghia_pham's user avatar
0 votes
2 answers
331 views

Opening gnome-terminal and running a command that uses environmental variables from .bashrc

I am making a .sh file that would be run by Right click -> Run as program by non-power-users. It should open a terminal window and run a docker run command, that uses some environmental variables. ...
Rolf's user avatar
  • 103
0 votes
0 answers
219 views

DISPLAY and GNOME_SETUP_DISPLAY

I am on Ubuntu 22.04.2, under wayland (xwayland) I echoed DISPLAY and GNOME_SETUP_DISPLAY, but the values differs. $DISPLAY=:0 $GNOME_SETUPDISPLAY=:2 I would like to know why mismatches Why? And what ...
Luiz Carlos's user avatar
0 votes
1 answer
439 views

KUbuntu 22.04.1, where are these locale variables set?

First time using KUbuntu (22.04.1 LTS); used to use Mate & LUbuntu before. This is the rxvt-unicode that I'm used to: This is the new rxvt-unicode in Ubuntu 22.04.1 that I'm having: Found the ...
xpt's user avatar
  • 1,055
1 vote
0 answers
53 views

I dont understand how to use JAVA_HOME

The scenario is 1 system user that is running multiple java services that require different java versions... yes it is a Minecraft server... minecraft 1.17+ requires a different version so I need to ...
Eric's user avatar
  • 11
0 votes
1 answer
411 views

How to set PATH, HOME, JAVA_HOME variables correctly for working with maven after Java-JDK installations?

I visited the webpage at https://help.ubuntu.com/community/EnvironmentVariables and find out about setting environment variables and local user variables and have got a pretty clear picture. But I am ...
P_Z's user avatar
  • 101
0 votes
0 answers
284 views

Ubuntu service file not finding module from environment

My Linux service runs a script that produces an error that a module is not found. However, when I run the script from the terminal with the python environment activated the script works fine. I run ...
costa rica's user avatar
0 votes
1 answer
1k views

$PATH - No such file or directory (but all files and directories exist)

I am running Ubuntu 22.04 LTS and at first when I was attempting to use a script that would do the following: . ~/.bashrc conda activate {env} I would receive an error that conda init needs to be ...
Calvin's user avatar
  • 11

1
2 3 4 5
21