Questions tagged [environment-variables]
A set of dynamic variables that can affect the running processes behavior and access to resources.
1,025
questions
0
votes
1
answer
123
views
What does the variable $SHELL do, entered without any command?
I know that $SHELL is an environment-variable, which refers to the current default-shell. echo $SHELL prints the path to stdout.
Here the use of it for keeping the terminal window open:
How to run a ...
0
votes
1
answer
273
views
System wide variables not accessible by System V init scripts
I have a script in /etc/init.d/ called foo.sh that runs six (JAVA) Spring Boot jars. All of the jars require environmental variables to run. This script was added to rc.d via update-rc.d foo.sh ...
7
votes
1
answer
981
views
Add an editor to a list of terminal system editors
When you use vipw or crontab or just type select-editor you are presented with the list of the editors installed on the system. How do I add my custom editor to that list?
2
votes
0
answers
4k
views
how to run or re-load /etc/profile.d/ scripts?
From within the GUI, I'm seeing this result:
My problem is exactly that this does not happen in the terminal run
under the graphical user interface; neither in Ubuntu 16.04.3 or
18.04. – Thomas ...
1
vote
3
answers
5k
views
tlmgr not found when run as root
I have installed TeXLive and added /usr/local/texlive/2019/bin/x86_64-linux to my $PATH through /etc/environment, so I should be able to run tlmgr from the terminal. I am able to do that as non-root ...
0
votes
0
answers
907
views
add bash script to /etc/profile.d/ to load variables?
As a follow-on to a bash question on setting environment variables, I see:
/etc/profile.d/*.sh
Files with the .sh extension in the /etc/profile.d directory get executed whenever a bash login shell ...
0
votes
0
answers
174
views
how to make environment variables persist?
For this bash script:
#!/bin/sh
export AccessToken=678
export AccessTokenSecret=wxy
export ApiKey=abc
export ApiSecret=123
How can I then ensure that printenv run at a later point in time will show ...
2
votes
2
answers
5k
views
how to use setenv to set an environment variable?
I've tried a few variations on setenv usage, including:
thufir@dur:~/powershell/helloPSTwitterAPI$
thufir@dur:~/powershell/helloPSTwitterAPI$ setenv ApiKey="57647625454354365"
Command 'setenv' not ...
2
votes
1
answer
2k
views
How to set environment variables from within powershell?
How do I make foo an environment variable accessible through printenv on bash?
PS /home/thufir/powershell/helloPSTwitterAPI>
PS /home/thufir/powershell/helloPSTwitterAPI> $env:foo = 'x' * 333 +...
2
votes
1
answer
5k
views
how to pass a python variable into a bash script?
Can we pass a python variable into the bash environment, without invoking python environment in bash script
2
votes
1
answer
251
views
Bash SH - Set a new var name including in that name another var
I just need to create an incremental var name inside a loop. The variable must use "in the var name the number of the cycle".
Example inside a loop:
# on Cycle=1
MyVar$Cycle=Exec$Cycle # (equal to ...
1
vote
0
answers
152
views
After removing sddm and lubuntu-desktop, my desktop environment is missing some environment variables
After removing sddm and lubuntu-desktop, and using startx to spin up a graphical interface with my window manager of choice (cwm), ~/.local/bin is not on the PATH anymore. I googled around and it ...
0
votes
0
answers
479
views
Issue setting symbolic link for Julia Lang
I am running Ubuntu 18.04.3 LTS. I guess my question is a general question about symbolic links with a specific set up. However, I am new to Ubuntu and maybe I am wrong and my issue lies somewhere ...
0
votes
1
answer
94
views
UnicodeEncodeError when attempting to create a RAID-1 Ubuntu Server
I'm attempting to create a home NAS(Plex) using Ubuntu. I have two 8tb Seagate Ironwolf drives I'll be using in RAID-1 for the storage portion and I've also got a random 500gb drive that'll be used ...
1
vote
0
answers
755
views
(environment-modules) Setting up modulefile for Intel compilers
I am trying to install openmpi (not from apt) into my system. I want to use intel compilers (fortran, c and c++) for the compilation. When ./configure my openmpi folder, without module load intel, ...
1
vote
4
answers
489
views
BASH variables aren't loading properly on startup
I rarely post a question because I tend to get obsessed with trying to figure things out on my own, but today I am really stuck.... and I've had a long week and my brain is dead...
anyways, I am ...
0
votes
1
answer
951
views
Setting up custom modulefiles in environment-modules on ubuntu 18.04 LTS
Using environment-modules, I am trying to set up custom environment modules for installation of a software by using intel compiler and openmpi. I am not familiar with the method of creating a custom ...
0
votes
1
answer
424
views
Set path environment variable in Ubuntu [duplicate]
By mistake, I changed the path environment variable in Ubuntu.
Now when I turned my pc on, the login screen is coming and after entering my password and pressing enter, the screen goes away for a ...
0
votes
1
answer
441
views
Ubuntu 18.04.3: Set the environment for bash script that runs through Gnome Startup Application
On Ubuntu 18.04.3 GUI, I am using GNOME Startup Application to start my bashscript because @reboot for cron doesn't work for me (cron - crontab's @reboot only works for root? - Unix & Linux Stack ...
0
votes
1
answer
6k
views
How to permanently change a PATH variable in Debian [closed]
I'm trying to change the directory that is accessed when I call blender in my terminal.
This is currently where it is:
...$ which blender
/usr/bin/blender
And I'd like to instead use the version ...
7
votes
5
answers
3k
views
Alias for all users
I created a this file: /etc/profile.d/pycharm_alias.sh
startPyCharm() {...
}
alias py=startPyCharm
I rebooted the PC, but then the alias is not available:
===> alias
...empty
If I login to ...
4
votes
3
answers
4k
views
CLion doesn't pick up environment variables sourced in bashrc
Long Story (This is X)
TLDR / The Problem (This is Y)
Now, if running sh /opt/clion/bin/clion.sh from the Ubuntu terminal, CLion does pick up the environment variables sourced in the ~/.bashrc file, ...
0
votes
0
answers
56
views
Editing etc/profile.d/foo.sh
Edited my etc/profile.d/foo.sh with the following
PXR_PLUGINPATH_NAME = "/usr/redshift/redshift4solaris/18.0.287:&"
but on boot I get an error message saying PXR_PLUGINPATH_NAME command not ...
0
votes
2
answers
233
views
Allow All Users to Import Python Script
We have a JupyterHub server and it spawns Jupyter notebooks to users. I wrote a Python script and I want all users to be allowed to import it to their notebooks. There is a PYTHONPATH environment ...
1
vote
1
answer
742
views
Can't append to PATH in ~./bashrc using $Home
I just want to add a path in ~/.bashrc as:
export PATH="$Home/gg/gamit/bin:$Home/gg/kf/bin:$Home/gg/com:$PATH"
But when I am using echo $PATH is showing it as:
/gg/gamit/bin:/gg/kf/bin:/gg/com:/...
0
votes
1
answer
52
views
Add folders to .profile env vars
I have folder ~/Documents which contains several scripts. For example 1 of them is asleap. So, its full path will be ~/Documents/asleap and if i want to execute this script, I need to ./asleap inside ~...
1
vote
1
answer
2k
views
How to fix Conda "missing path to environment variable"?
I have a conda environment named tensorflow_p36. When I run import mujoco-py I get the following error:
Exception: Missing path to your environment variable.
Please add following line to ....
1
vote
0
answers
130
views
Setting permanent environment variables to run a folder with a self-compiled app
I'm new to Ubuntu (2 weeks trial & error) but quickly learning. I'm running Windows Subsystem for Linux (WSL) on Windows 10 Home edition with 18.04.3 LTS (Bionic Beaver). GUI working fine via LXDE ...
0
votes
1
answer
4k
views
Regarding command could not be located because '/bin' is not included in the PATH environment variable [duplicate]
I am facing issues with linux command execution:
root@PGStaging:/etc# ls
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment ...
0
votes
2
answers
129
views
Ubuntu 16.04 not running scripts in /etc/profile.d/
I have a machine running Ubuntu 16.04 Desktop (running Unity). I was playing around with different desktop environments for xrdp, so I installed xfce4 (sudo apt install xfce4) and mate-desktop (sudo ...
92
votes
1
answer
9k
views
How does sudo handle $HOME differently since 19.10?
In Ubuntu releases prior to Ubuntu 19.10 Eoan Ermine, when I run a command with sudo, that command receives my home directory in the $HOME environment variable. This is the behavior I have long ...
0
votes
1
answer
240
views
Run node script with a global variable
I have a node script index.js with a node_modules folder.
/script/myTestJscript/index.js
/script/myTestJscript/node_modules
/script/myTestJscript/package.json
I could run the script with the command ...
1
vote
1
answer
3k
views
Desktop application with file with environment variable
Context
XFCE4
Issue
Trying to run a software with a bunch of environment's variables stored into a file named prod.env, directly from autostart.
Here is the content of the .desktop file stored at /...
3
votes
2
answers
959
views
Permanently unset environment variable SUMO_HOME
Previously I installed sumo and set environment variable SUMO_HOME by adding SUMO_HOME='/usr/share/sumo' in /etc/environment.
Now I have uninstalled sumo and want to unset env var SUMO_HOME, I tried ...
6
votes
2
answers
13k
views
Why does "which python" return nothing?
If I type which python I get no output and I have no success using Miniconda as default Python. I did set paths to ${HOME}/.profile but no success.
Here is my ${HOME}/.profile
The last line is mine. ...
2
votes
1
answer
716
views
Reset PATH variable from TTY command line
I was in the process of installing Java 11 on Ubuntu 16.04 and decided to reboot my computer.
Now, when trying to login to my user or the guest user, when I press enter, I get a black screen followed ...
0
votes
1
answer
902
views
How to display all new variables after terminal started?
Often in a terminal session I do stuff like this:
$ Source="/bin"
$ AllFiles=$(ls $Source/* | wc -l)
$ echo $AllFiles
159
It is tedious typing echo $Source followed by echo $AllFiles, etc. to ...
1
vote
1
answer
1k
views
Set temporary environment and/or path in Ubuntu
I want to run a program which requires HDF5 1.8.21 (old ver). Now, I downloaded and compiled HDF5 1.8.21 in a separate folder (/opt/hdf5/hdf5-1.8.21/hdf5/bin). But because my desktop already has HDF5 ...
1
vote
3
answers
5k
views
Where is XDG_CONFIG_DIRS set?
If my understanding is correct, Ubuntu and variants set XDG_CONFIG_DIRS to something like
XDG_CONFIG_DIRS=/etc/xdg/xdg-$VARIANT:/etc/xdg
Then, package-provided system-wide configuration defaults in /...
1
vote
1
answer
997
views
Problem ANDROID_HOME when build APK iOnic
I have a problem when I try build apk from my iOnic app.
When I send $sudo ionic cordova build --release android --verbose
Return this:
**Failed to find 'ANDROID_HOME' environment variable.** Try ...
0
votes
2
answers
2k
views
Need to add something permanently to my PATH [duplicate]
I'm really struggling with the different tutorials as I keep getting errors or I keep getting told that what I'm doing isn't recognised as a command so I would really appreciate it if someone could ...
6
votes
1
answer
1k
views
`sudo` is not using the right binary, even when $PATH is correctly passed
I am trying to run a Pipenv python instance as root. When not run as root:
(myenv) $ python script.py
the Pipenv python is correctly used. However, when run as root with sudo:
(myenv) $ sudo python ...
12
votes
1
answer
11k
views
Should I put an alias in .bashrc or .profile?
I want the following alias to be available each time I open a shell:
export ZONE="us-eastern1-c"
export INSTANCE_NAME="myInstance"
alias gc='gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -...
2
votes
1
answer
3k
views
SSH with remote command and keep session alive
I want to ssh to remote machine while setting some environment variable.
Let's just say, I don't want to make any changes on remote machine.
I want to do something like:
ssh remote-server "NAME=$...
3
votes
2
answers
174
views
When using a variable to set the path, I get "No such file or directory", but works fine otherwise
I set the variable CATKIN_WS="~/catkin_ws", but when I use it, it does not work. However, if I simply go to the path that I have set it at, I have no problems. Why does it not work when I set it as a ...
2
votes
0
answers
34
views
Pass environment variables to .desktop file Exec entry [duplicate]
I want to create a shortcut that executes a program with an environment variable set, for example:
[Desktop Entry]
Version=1.0
Name=Chromium test UTC
Exec=TZ=UTC chromium-browser
The syntax above ...
1
vote
1
answer
2k
views
Configure sudo to keep SSH_AUTH_SOCK
What's the proper way to configure sudo to keep the SSH_AUTH_SOCK environment variable?
I was following some guide on the Internet, but it is not working for me:
$ printenv | grep SSH
SSH_AUTH_SOCK=/...
1
vote
3
answers
738
views
can't add value with sharp sign in environment variable
I need set a password to environment variable but the problem is password include sharp sign and when i want use this variable just show me till first sharp sign. for example assume he#l#lo is my ...
2
votes
1
answer
3k
views
PHP Environment Variables in CLI
Environment Variables are used to set up the PHP application and the application runs smoothly.
The issue that I'm facing is when I'm trying to reference the application's database connection file and ...
4
votes
2
answers
9k
views
systemctl .service can't read the environment variable
I'm using django and now trying to configure server with nginx and uwsi. now i'm running nginx+socket+uwsgi_emperor well . for running uwsgi i use below command in terminal:
/usr/local/bin/uwsgi --...