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
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 ...
st88's user avatar
  • 13
0 votes
1 answer
274 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 ...
Nimchip's user avatar
  • 141
7 votes
1 answer
993 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?
exebook's user avatar
  • 359
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 ...
Thufir's user avatar
  • 4,551
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 ...
Ntakwetet's user avatar
  • 1,506
0 votes
0 answers
908 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 ...
Thufir's user avatar
  • 4,551
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 ...
Thufir's user avatar
  • 4,551
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 ...
Thufir's user avatar
  • 4,551
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 +...
Thufir's user avatar
  • 4,551
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
 younus's user avatar
  • 123
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 ...
MauSH's user avatar
  • 33
1 vote
0 answers
153 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 ...
Dominykas Mostauskis's user avatar
0 votes
0 answers
483 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 ...
Roberto Amaral Santos's user avatar
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 ...
KickN's user avatar
  • 101
1 vote
0 answers
759 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, ...
fizsics's user avatar
  • 13
1 vote
4 answers
490 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 ...
Booey's user avatar
  • 17
0 votes
1 answer
956 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 ...
fizsics's user avatar
  • 13
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 ...
Dpk Baba's user avatar
0 votes
1 answer
443 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 ...
Porcupine's user avatar
  • 679
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 ...
Otherness's user avatar
  • 113
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 ...
guettli's user avatar
  • 1,737
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, ...
IgNite's user avatar
  • 231
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 ...
Bachalo's user avatar
  • 753
0 votes
2 answers
235 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 ...
tkarahan's user avatar
  • 101
1 vote
1 answer
743 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:/...
sandeep gupta's user avatar
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 ~...
user avatar
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 ....
rrz0's user avatar
  • 161
1 vote
0 answers
131 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 ...
Herman's user avatar
  • 11
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 ...
Durgamahesh Manne's user avatar
0 votes
2 answers
130 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 ...
Farzad F.'s user avatar
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 ...
Eliah Kagan's user avatar
0 votes
1 answer
241 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 ...
emna87's user avatar
  • 1
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 /...
user7364588's user avatar
3 votes
2 answers
962 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 ...
chunky's user avatar
  • 31
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. ...
YohanRoth's user avatar
  • 161
2 votes
1 answer
719 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 ...
it_always_ends_with_a_j's user avatar
0 votes
1 answer
905 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 ...
WinEunuuchs2Unix's user avatar
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 ...
Aman_X's user avatar
  • 51
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 /...
Gamification's user avatar
1 vote
1 answer
999 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 ...
David Diaz's user avatar
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 ...
Retsek's user avatar
  • 155
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 ...
retnikt's user avatar
  • 192
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 -- -...
DeltaIV's user avatar
  • 285
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=$...
user2984602's user avatar
3 votes
2 answers
176 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 ...
Cedric Martens's user avatar
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 ...
Dan Dascalescu's user avatar
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=/...
xpt's user avatar
  • 1,045
1 vote
3 answers
745 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 ...
mehdi's user avatar
  • 199
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 ...
Navaneeth Mohan's user avatar
4 votes
2 answers
10k 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 --...
mehdi's user avatar
  • 199

1
3 4
5
6 7
21