Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [environment-variables]

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

1
vote
1answer
31 views
+50

System wide variables for both init scripts and system?

I created my own init scripts that use variables: #! /bin/sh case "$1" in start) echo "Starting Public API" sudo -u techops sh ${JBOSS_HOME_PUBLIC_API}/bin/standalone.sh > ${...
0
votes
1answer
32 views

go still run even its path not in environment variable path?

I install go by snap, the path to executable file of go is not in environment variable path, but when I use go run test.go in terminal (from my home directory), go still work. As my understand, the ...
0
votes
0answers
34 views

Shell environment variable [duplicate]

Whenever i try to save a variable in .bashrc file of my home directory, it's not giving me the desired result. I'm trying to save D=/home/winie/Desktop ; export D But when i do echo $D in shell, it ...
0
votes
0answers
27 views

Open SSL make not working

I am trying to get openssl 1.1.1 so I can use TLS 1.3 with nginx, below is my code as well as the error Best I can figure is that LIBRPATH is empty and that would cause the issue but I can't seem to ...
1
vote
1answer
38 views

Change global environment variable using a script that is started using xbindkeys?

TLDR: I have a simple shell script that flips an environment variable from value foo to bar, or the other way round, depending on its current value. I use F12 to trigger this script, and I know that ...
1
vote
0answers
38 views

Why my system sometimes forgets the environment variables

Sometimes (I cannot locate better: may happen when I am developing, may happen in two weeks or so after several on/offs) my system forgets the environmental variables I set. (i.e. 'echo' display empty ...
0
votes
1answer
148 views

“Could not connect to any X display” with gnuplot (Ubuntu for windows)

I have installed the Ubuntu extension for Windows, but I run into troubles when I want to use gnuplot... I am just trying to plot a simple data file, but I get the following error : QStandardPaths: ...
0
votes
0answers
32 views

Adding Eclipse file to PATH is not effective [duplicate]

My eclipse is in /home/username/eclipse/eclipse and I can start it by running cd ~/eclipse ./eclipse I want to start it with only eclipse in the terminal. So I add this line to both /etc/profile ...
0
votes
1answer
60 views

Messed up my PATH environment variable and can't login to desktop

To get an maven environment variable to run, I tried several options. Basically, I followed some options from Ubuntu Community Page, such as ~/.pam_environment, /etc/bash.bashrc and I don't really ...
1
vote
0answers
23 views

help setting environment variables [duplicate]

Checking for required M4 macros... libtool.m4 not found glib-gettext.m4 not found intltool.m4 not found pkg.m4 not found ***Error***: some autoconf macros required to build Package were not ...
0
votes
0answers
15 views

Remote SSH command with export will reset environment variable? [duplicate]

I'm using remote ssh command with "export" to add environment variable, like this: $ ssh jenkins@test "export PATH=${PATH}:/opt/xxx; env" And the PATH listed in env is PATH=/home/administrator/bin:/...
0
votes
0answers
27 views

Wrong LINES variable value in terminal - how to fix?

I use Xubuntu 18.04.1 and xterm. The issue is observed when I connect to telnetd from busybox-static package. COLUMNS variable is set correctly, but LINES one is set to 65280 under certain ...
0
votes
0answers
43 views

Startup command with variable settings

I have Xubuntu 16.04 for 2 days. I am trying to set an entry in Session and Startup>Application Autostart that will set several bash variables and execute a command. I have managed how to do it ...
0
votes
0answers
19 views

Reading system varibles in script

I am trying to read a system variable that is XDG_CURRENT_DESKTOP from a shell script. echo the variable in terminal works fine. but when running it within a bash script it echoes empty due to that ...
0
votes
1answer
61 views

Using /etc/environment.d/*.conf to set global environment for all users

Is /etc/environment.d/*.conf a valid place to put environment config on Ubuntu 18.04 for all users? I've tried a file with the following contents: BRAD_TEST=true However, after logging in and ...
1
vote
1answer
29 views

Where is LD_LIBRARY_PATH and PATH?

I type echo $LD_LIBRARY_PATH and got /usr/local/cuda-9.0/lib64 but when I check my bashrc file they are not there. Where are they ? # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/...
0
votes
0answers
29 views

How to set up JAVA_HOME when connect through ssh and using Bourne compatible Shell? [duplicate]

Java developers require the JAVA_HOME environment variable set in /usr/local/java8 in their environment when they connect through ssh and log in using a Bourne compatible Shell. As such, a readonly ...
0
votes
1answer
20 views

Exporting env variables persistantly

I'm trying to figure out how to create persistant environment variables for my "root" user. I've tried running this in command line: export ETSY_CONSUMER_SECRET='xxx' export ETSY_CONSUMER_KEY='xxx' ...
0
votes
1answer
58 views

XDG_CURRENT_DESKTOP shows KDE even though I'm running gnome (in some apps)

I've installed kubuntu 18.04 on my laptop. At some point I've decided to try gnome and installed ubuntu-desktop. I've stick with that and removed most kde/plasma packages few weeks back. I've even ...
0
votes
0answers
41 views

Path variable is not working, the folder can not be traced [duplicate]

The conda command is not found, so I install the anaconda2 in my home folder, and setup the PATH variable to it: export PATH=~/anaconda2/bin:$PATH I tried close and reopen the terminal, restart the ...
0
votes
1answer
16 views

How to explort content from file into variable? [duplicate]

I need save into variable the file content (json string). I try several methods, in particular: #!/bin/bash myjson=cat patch/file.jsn but nothing not work. How to correctly implement this task?
0
votes
1answer
38 views

.bashrc vs environment for setting environment variables [duplicate]

Can anyone explain the difference between $ gedit ~/.bashrc and $sudo -H gedit /etc/environment in setting environment variables?
0
votes
1answer
41 views

echo an environment variable in bash

I don't understand why this doesn't work: TEXT="blah" echo $TEXT #echoes nothing I thought it might be because echo is a builtin, so I tried this: TEXT="blah" `which echo` $TEXT #still ...
0
votes
1answer
9 views

Where does bash take its PATH from if run with --norc option? [duplicate]

Trying to find out where the . (current directory) entry in PATH originates, I've run bash as follows: $ env -i /bin/bash --norc -c 'echo $PATH' /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:...
0
votes
0answers
21 views

Add a directory as library to my java file [duplicate]

I am trying to add a library path to use for my java code. I have several file in usr/local/lib directory. To use the files in that directory as library I am using the following command export ...
0
votes
1answer
70 views

How to set JAVA_HOME and NUTCH_JAVA_HOME in ubuntu., I tried but while compile nutch with ANT but getting this error

I'm very new to ubuntu, I have installed java and while compiling nutch am getting this error. BUILD FAILED /home/surukam/Desktop/Nutch/nutch/build.xml:101: Unable to find a javac compiler; com.sun....
1
vote
2answers
34 views

How to take value as value without considering it as string when we do cat and grep

I have created the utility that need to be run in all the system without any error by creating the required environment. When ever I run the following command it will take the path value from a config ...
3
votes
1answer
197 views

How to add /usr/bin to path after I mistakenly removed it (sudo and nano are no longer in path) [duplicate]

Lets get this out of the way, I did something stupid. Yes, stupid. Very stupid. I am well aware of how stupid this is. I am embarrassed and I regret doing it. Please help. I was installing a program, ...
2
votes
1answer
146 views

Getting Java Error Message - JAVA_HOME is not valid:

I'm trying to set up OpenDaylight which is a SDN controller on Ubuntu Virtual Box. The version of Ubuntu is 18.04. OpenDaylight requires java-8-openjdk-amd64 and I have installed it successfully: See ...
0
votes
1answer
92 views

update-alternatives does not work due to /usr/local/bin precedence

I have faced with an issue that when I search proper version of python I every time found python 3.7: python3 --version Python 3.7.0 Then I have checked update-alternatives configuration: sudo ...
1
vote
1answer
174 views

Why can't I launch eclipse from a terminal ? change $PATH environment variable [duplicate]

I want to run eclipse via terminal. Eclipse is in this directory ~/eclipse/java-photon/eclipse/. When I write in terminal cd ~/eclipse/java-photon/eclipse/ and then ./eclipse it works. But how can ...
0
votes
0answers
147 views

How to create permanent env Varibales and PATH in .bash_profile

I am new in Ubuntu and generally Linux. Setting up React Native for development following official DOCsI faced a problem. when I define path variables in .bashrc on every logout/restart the PATH and ...
0
votes
0answers
71 views

ANDROID_HOME varibale changed to PWD

I want to setup Android SDK on Ubuntu 18.04.1 LTS for React Native programming. according to the official Docs I have to define paths in .bash_profile. at first I was just putting the export commands ...
0
votes
1answer
199 views

java -version still shows old $JAVA_HOME

I unknowingly downloaded the wrong jdk onto my system (openjdk 11) and would prefer java 1.8.0_181 to be installed. I'm just looking to run an application so I believe that jre is all that is needed. ...
2
votes
2answers
64 views

How can I add a directory to PATH in a script so that it affects the calling shell and the rest of the session?

I am new to Ubuntu. I wrote a script to add a dir to the PATH environment. When I run the script it runs fine and the dir is added to the PATH. But it seems that the change only lasts until the ...
0
votes
0answers
12 views

PATH in bootup depending on uname

I would like to add a directory to PATH at an early stage of boot that is relative to $(uname -r). More specific I want to run 2 versions of zfs userland depending on which kernel is run. I tried to ...
0
votes
0answers
431 views

Ubuntu 18.04, cannot set LD_LIBRARY_PATH

In Ubuntu 16, I had set LD_LIBRARY_PATH via the file /etc/environment and it worked (guaranteed). After the upgrade to 18.04 it does not. I read various posts and the documentation regarding ...
0
votes
0answers
22 views

Reading variables interactively from a terminal command

I am trying to read a variable from a terminal command which is based on a software "GROMACS" and goes as follows : gmx pdb2gmx -f test.pdb -glu -asp -ignh This command results in an interactive ...
0
votes
0answers
28 views

Lines for proxy in /etc/environemt file

If proxy is my proxy address, then http_proxy="http://proxy:8080/" https_proxy="http://proxy:8080/" ftp_proxy="http://proxy:8080/" HTTP_PROXY="http://proxy:8080/" HTTPS_PROXY="...
1
vote
0answers
500 views

Passing environment variables to systemd service

I am trying to start phoenix framework using systemd but the problem is phoenix app is not getting environment variables. Below is my system service [Unit] Description=Runner for Application After=...
0
votes
1answer
244 views

How to reload environmental variables in .profile using source for entire session? [duplicate]

So I need to reload my profile after making changes (this time due to a typo). I run source ~/.profile and everything works perfectly fine. However the source command only applies to that terminal ...
1
vote
1answer
33 views

how to make sure env variable will not be displayed when ran a script in debug mode

[yesh]$ env | grep password password=hello -> tsts is my script which uses env variable password. [yesh]$ grep password tsts export DB_PWD="$password" -> this is my script running in debug mode [...
0
votes
0answers
43 views

How to find all instances where PATH is defined? [duplicate]

In my PATH variable I see duplicate paths that I have no idea how they ended up there. /home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/...
2
votes
1answer
116 views

Unable to use variables in alias in cshell

This is a sample straight forward program. I am using C-shell and want a solution for this environment itself. Following this code sample: set FILENAME = "\!:2" alias jo 'echo this is my \!:1 file ...
1
vote
1answer
234 views

Setting path to java_home

I am a beginner to Java as well as to Ubuntu. I downloaded JDK 10.0.2 zip file and unzipped using tar command. I used vim .bashrc and typed the following export JAVA_HOME=path of my Java export ...
1
vote
0answers
194 views

Unable to configure proxy settings in /etc/environment - file is read-only

I'm trying to get Ubuntu Core 16 to use a proxy to talk to the snap store. When attempting to edit /etc/environment, I'm unable to save my change, due to it being read-only. (The file permissions ...
0
votes
1answer
215 views

Is $PATH in WSL supposed to be very long?

Anybody else get an extra long path using echo $PATH command? I'm working in BASH shell Ubuntu on windows from the Windows app store. Output of echo $PATH: home/mnhir/bin:/home/mnhir/.local/bin:/usr/...
4
votes
3answers
1k views

Set LD_LIBRARY_PATH correctly

I am using Docker with image of Ubuntu 16.04. I am using this docker to run: Import C++ classes in python with the help of boost.python Import matlab's python package in python with the help Matlab ...
1
vote
0answers
37 views

Time Zones: TZ vs tzselect vs timedatectl

I have a software package that (I am told) has to read the TZ environment variable, and if that variable is not set it can cause dates/times to be incorrect. Not sure if it is doing its own offset ...
0
votes
1answer
80 views

Understanding how PATH environment variable works

I have followed many guides and books to understand the PATH variable concept but none of them explains "completely" how this works in Linux. For example if I set a a Path like the following in Bash: ...