Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
31 views

Debian Linux - Setting an environment variable for all users

I added the following in /etc/profile so that all my users can see the path export JAVA_HOME=/opt/jdk11 export PATH=$PATH:$JAVA_HOME/bin But after restarting my laptop, I cannot see the changes ...
1
vote
2answers
42 views

Bash environment variables in non interactive mode

I'm trying to define environment variable for non-interactive console in Raspbian. In theory I need to add the varaibles to ~/.bashrc or ~/.profile or /etc/bash.bashrc or /etc/profile. For example I ...
5
votes
3answers
927 views

Equivalent to “source” in OpenBSD?

Trying to open a python3 virtual environment I have created with python3 -m venv myVenv by doing source myVenv/bin/activate as I do in Linux, but I get ksh: source: not found which mean it is ...
0
votes
0answers
33 views

How do I get CRON to run a script that works in my regular shell, but not in CRON? [duplicate]

I am running Ubuntu 18.04 LTS on an Amazon LightSail instance. When I try to run a Python script as soon as I log, it runs perfectly. I run my script with the full path in with the command: /usr/bin/...
1
vote
1answer
42 views

How to persist environment variables in ash, the Almquist shell?

How can I get ash to load some environment variables on startup? Just put them in /etc/profile /etc/profile is only read for login shells; what about non-login shells, as frequently pop up when ...
0
votes
1answer
81 views

How to change default text edior for virsh edit? (setting EDITOR env variable didn't work)

I recently installed virt-manager on an Arch Linux install, and unlike under Ubuntu, I was not prompted to choose a text editor on the first launch of virsh-edit. Instead, the XML file was opened in ...
0
votes
0answers
25 views

HTTPS=true is not working [duplicate]

I'm trying to set the environment variable HTTPS=true in macOS bash shell but it doesn't work when I printenv the variable HTTPS=true doesn't appear: TERM_PROGRAM=Apple_Terminal SHELL=/bin/bash TERM=...
0
votes
1answer
24 views

Comparing working directory with “string” [duplicate]

I'm trying to compare the current working directory's path with my home directory's path. user@machine:~$ echo $PWD /home/user user@machine:~$ if ["$PWD" = "/home/user"]; then echo True; else echo ...
0
votes
0answers
24 views

Init script not picking up environment variable set in /etc/environment?

What is the right way to set a global environment variable, such that it is picked up all processes, including those started via init.d (service <service> start), on Ubuntu? Details: I first ...
0
votes
3answers
50 views

Which quoting style GNU Bash variable definitions (mostly for paths)? [closed]

Which of the following quoting styles, for GNU Bash variables, is preferred and why? Two double quotes: VAR="/path/$V1/path with space/$V2". Multiple double quotes: VAR=/path/"$V1"/"path with space"/"...
0
votes
0answers
26 views

How do I prevent module load conflicts (environment modules)?

I am setting up Environment Modules for a server and have two modules: test1 and test2. Test1 needs java 1.7.0 and test2 needs java 1.8.0. If I use prereqs/conflicts, as seems to be standard ...
1
vote
1answer
43 views

How do I properly change the debian default python 2.7.9 to python3 or another version? [duplicate]

what is best-practice for changing the default global python interpreter on my fresh debian-based linux node to python3.x? When I create a fresh Debian or Ubuntu VM, one of the first things I do is ...
1
vote
1answer
38 views

My Java environment variables seem to be a complete mess how do I make a clean start without reinstalling?

I am trying to get Janusgraph working on OpenSuse Leap 42.3 but I'm running into a multitude of problems. My understanding is that JanusGraph invokes other Java dependencies, including gremlin & ...
1
vote
0answers
53 views

How can I set and export an environment variable in a systemd service?

after starting agetty on my Raspberry Pi in order to attach a VT420 terminal to it, I still have an issue: The shell language must be set to en_US and exported by hand right after logging in on the ...
4
votes
1answer
152 views

Bash can't find scripts in $PATH [closed]

I'm setting up a completely new, fresh Ubuntu 16.04 Minimal system, and have run into a weird problem. Even after adding $HOME/bin to the $PATH, bash can't seem to find any of the scripts in it, at ...
1
vote
1answer
78 views

Why is my BASH_FUNC_foobar%% environment variable unset in shell subprocesses?

I'm messing around with the security of a setuid binary (with the intention of disclosing anything I find to the author, obviously). I'm pretty sure it has an arbitrary code execution vulnerability ...
0
votes
2answers
50 views

Eval and exec with variable substitution

I'd like to execute a statement to start a server. For that I have an environment variable to determine which server is to be started. I was given this command as a starting point: eval "exec ...
0
votes
0answers
11 views

set env variable apache when accessing a specific url

is there a way to take a user id sent in the http header and to rewrite it to a variable "remote_user" but only when accessing a particular URL? I'm aware of SetEnv but that doesn't do the trick I ...
0
votes
1answer
57 views

How do I use ssh-agent as a wrapper program?

I'm trying to start awesome windows manager as a subprocess of ssh-agent. It worked when I used startx (ssh-agent startx). But now I'm trying to make it work under lightdm. lightdm starts /usr/bin/...
0
votes
1answer
35 views

Java-like properties file to environment variables

I need to convert each property of a properties file to a environment variable: I mean, guess this property file: mongo.port=27017 mongo.host=127.0.0.1 mongo.databaseName = test bo.url-jwt=https://...
3
votes
1answer
124 views

How is the C library able to access environment variables?

This may be a dumb question, as I feel like I must be overlooking something fairly obvious, but how do functions like getenv(3) access the environment when my program doesn't have any references to ...
1
vote
2answers
67 views

How can I “source” expect script

I'm forced to use a script like below: # test.sh function my_fun { echo "Give value for FOO" local my_var read my_var export FOO=$my_var } # Call my_fun function my_fun by sourcing ...
0
votes
1answer
45 views

Where to define proxy environment variables for firefox started via desktop links in lxde/debian9?

I'm trying to set the system-wide http_proxy environment variables (automated by a shell script) in such a way, that firefox uses them when executed from the LXDE start menu for all users. So far I ...
0
votes
1answer
105 views

Expand variables in local bash script before passing it to SSH

I am trying to execute a script on a remote host through SSH. The script uses environment variables that are set on the local shell. The variables in the script are not expanded. ssh user@host 'bash -...
0
votes
2answers
93 views

Apache/Nginx document root environment-variable

Apache/Nginx "default" document root path is usally /var/www/html but theoretically this could change tomorrow. Having a distro-default and communally-maintained environment variable for it (instead ...
2
votes
2answers
416 views

import environment variables in a bash script

I set some environment variables in a terminal, and then run my script. How can I pull in the variables in the script? I need to know their values. Simply referring to them as $MY_VAR1 doesn't work; ...
2
votes
1answer
40 views

cannot find package with running go build

root@kali:~/subfinder# go build main.go:15:2: cannot find package "github.com/subfinder/subfinder/libsubfinder/helper" in any of: /usr/lib/go-1.11/src/github.com/subfinder/subfinder/libsubfinder/...
1
vote
1answer
28 views

Messed up environment variables in Centos 7

When I am running my maven build I am getting this error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/bin/bin/java I have edited .bashrc, .profile, /root/.profile and /root/....
3
votes
2answers
89 views

How do I specify a path to an executable for a systemd unit file on nix?

I'm trying to write a systemd unit file. How do I specify the path to an executable? How can I determine what to use? In this specific case I'm trying to use mkdir. ExecStartPre = "/bin/mkdir -p %h/...
1
vote
1answer
34 views

RedHat/Centos6.5 Environmental Variables Set on Startup - but from where? [duplicate]

I using Redhat/Centos 6.5. I am starting up the system and it already has environment variables set and is already running processes when it starts up. My questions: Where do these environment ...
3
votes
0answers
96 views

How to protect an EnvironmentFile used by a systemd service?

Background I have multiple RESTful web services being deployed through Azure DevOps Release Pipelines to a CentOS VM. Each of these services is managed by systemd and uses environment variables to ...
1
vote
0answers
36 views

Linking issues with leptonica and libpng

Working through an install of tesseract without sudo permissions and without a standard bevy of prebuilt libraries. The installation I've got to go through as far as I know follows the path of zlib -> ...
1
vote
0answers
8 views

What is the environmental variable that shows “executable folder” for Eclipse cdt?

In Eclipse cdt, I'm trying to make a project link a library from same folder of application executable (Debug at the moment). When I set "library search path" as ${PWD} it doesn't find the library ...
3
votes
3answers
810 views

How to create an environment variable that is the output of a command

How do I create an environment variable that is the result of a specific command? Specifically, I want an environment variable ($BWD) that is the basename of $PWD $ cd /home/devel/Autils/lib $ echo $...
4
votes
2answers
374 views

Cron is trying (and failing) to open env file: /etc/environment

I'm using Devuan ASCII (which is more or less Debian 9, Stretch). Now, my /var/log/auth.log has a bunch of these entries: Jan 6 09:45:01 mybox CRON[20951]: pam_env(cron:session): Unable to open env ...
1
vote
1answer
45 views

Exporting $PULSE_SERVER at start up

In order to run flatpak applications (like Discord or Spotify) I currently have to export the $PUSLE_SERVER in my ~/.zshrc or ~/.bashrc like so: export PULSE_SERVER=unix:/tmp/pulse-PKdhtXMmr18n/...
3
votes
1answer
64 views

see the LD_LIBRARY_PATH libraries

As I know we can define the search path for additional non standard libraries using export LD_LIBRAY_PATH. How can I see the list of these additional libraries after setting LD_LIBRARY_PATH?
10
votes
2answers
649 views

Why can I not use variables as prefix to a command to set environment variables?

Normally, it is possible to set an environment variable for a command by prefixing it like so: hello=hi bash -c 'echo $hello' I also know that we can use a variable to substitute any part of a ...
0
votes
2answers
74 views

Question about global environment variables and fork() & exec() [duplicate]

What I'm trying to understand is where does a child process inherit exported variables from it's parent process What I'm trying to understand is where a child process inherits exported environment ...
0
votes
2answers
101 views

How to override local variable by environment variable

I have one script running in production where one value assigns but i want to use a different value from here. My script.sh a=20181214 .... I was calling this script after export a=20181212 and ...
2
votes
1answer
30 views

Prevent print -P from substituting environment variable

I am using prompt pure as my prompt in zsh. Internally it uses print -Pn ... to print out the current directory. For some reason, if I have an environment variable set that matches the beginning of ...
0
votes
0answers
47 views

What effect does environmental variable CLUTTER_IM_MODULE have?

I knows this can be set like as CLUTTER_IM_MODULE=xim, but I don't know what effect this variable has.
0
votes
0answers
40 views

ownCloud with mariadb under docker-not avalable connection

I tried to use official documentation https://github.com/owncloud-docker/serverwith docker-compose. My .env file: OWNCLOUD_VERSION=10.0 OWNCLOUD_DOMAIN=localhost ADMIN_USERNAME=admin ADMIN_PASSWORD=...
1
vote
0answers
20 views

Systemd service for a ruby rake job and environmental variables

I have many environmental variables that are required to run my ruby rake job. This job will be supervised by systemd. How can I export all the environmental variables? And also export them in such ...
12
votes
1answer
361 views

Find description in man pages for environment variables shown with env command

In man pages, where can I find a detailed description of the environment variables that are listed when env command is run? I have tried man env but it only provides me one example for TZ environment ...
1
vote
3answers
179 views

Screen and kitty what should $TERM be?

Why does tmux report $TERM=screen-256color Normally kitty reports $TERM=xterm-kitty Which should I use if I run tmux inside kitty? Obviously kitty provides advanced functionality and that makes ...
1
vote
1answer
397 views

How to properly set Environment variables (golang on Manjaro)

I have a problem with my go installation. I'm using Manjaro and I think it is related to this as Manjaro seems to handle the go env differently then suggestest by ubuntu and windows. I have go ...
2
votes
0answers
49 views

autocomplete with inline variable setting

I use bash version 4.4.19(1)-release (x86_64-apple-darwin17.3.0) on my Mac with MacOS (10.13.6) For example, I have autocomplete set up for the AWS CLI, via complete -C '/Users/jstoner/Library/...
0
votes
2answers
51 views

How do I put an argument into the BROWSER variable?

I like to be able to do export BROWSER="lynx -cfg=~/.lynx.cfg". I tried this directly, and I also tried setting an alias alias lynx="lynx -cfg=~/.lynx.cfg", but these didn't work. (Meaning that tools ...
4
votes
1answer
293 views

Cannot change the environment variable

WHAT I AM USING zsh MacOS Mojave 14.10 WHAT I WANT TO DO $ echo $USERNAME myusername $ export USERNAME=newvalue $ echo $USERNAME newvalue WHAT IS HAPPENING $ echo $USERNAME myusername $ export ...