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
votes
0answers
20 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
68 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
12 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
19 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
47 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/...
0
votes
1answer
27 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: 1) Where do these environment ...
3
votes
0answers
44 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
22 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
620 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
330 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
25 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/...
2
votes
1answer
42 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
554 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
54 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
36 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
26 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
22 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
16 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
11 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
339 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
91 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
125 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
43 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
47 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
283 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 ...
0
votes
1answer
51 views

In bash, how do I list environment variables matching “MY_VAR” and then export them?

I want to export all environment variables beginning with "MY_VAR_". How do I do this?
0
votes
1answer
21 views

Does creating a new shell via bash -c passes environment

Assuming we want to run multiple bash commands via bash -c "command1 && command2 || command3" Will the new shell inherit the environment of the bash -c command?
0
votes
1answer
60 views

Sourcing .bashrc inside script doesn't update the env variables

I have a long installation script that frequently inserts env variables into .bashrc for immediate and future use, then sources .bashrc to update the env variables. However, this is not working as ...
0
votes
0answers
20 views

Effect of environment on binutils string sorting order [duplicate]

What is the default string sorting order of ls and sort? According to man 1 sort, the variable LC_ALL determines the order, but I can't determine which locale code corresponds to my default sorting ...
0
votes
2answers
58 views

Zsh: add folder to $path recursively

I have ~/bin folder that contains multiple subfolders with arbitrary directory levels. This folder only for executable files that need to be added to path when start zsh, how to recursively add all ...
0
votes
1answer
87 views

PulseAudio fails to launch in system mode in CentOS 7

Long story short, I'm trying to setup PulseAudio to act as a loopback interface for a local music stream. However, I'm hitting a breaking point in getting it setup. As I understand it, you cannot ...
1
vote
0answers
55 views

Why my newly created user is not inheriting $PATH variable

I added a new user dev on my Alpine based image. After switching to the new user I see env variables are different in case of both root and dev user. Specially $PATH variable is different. But I think ...
4
votes
0answers
172 views

Passing environment variables around in systemd

EnvironmentFile is not an option as per this answer. I am trying to understand the recommended way of using and passing environment variables. I have a urxvtd.socket: [Unit] Description=urxvt ...
2
votes
2answers
93 views

Where is the PATH variable set when I start a Bash shell with env -i bash?

I know that environment variables are set through reading or executing several configuration files, such as /etc/environment, /etc/profile, ~/.profile, ~/.bashrc, etc. But when I was reading this ...
1
vote
0answers
45 views

Websocket server won't connect if started via PHP

I have a websocket server written in Node. The following instruction, when executed from the command line starts the websocket server successfully: nohup "/root/.nvm/versions/node/v8.11.1/bin/node" "/...
0
votes
2answers
69 views

what application owns the $EDITOR and/or $VISUAL variable?

Im tidying up my bash exports file and categorizing variables depending what environment they are belong to. for example the HISTIGNORE, PATH, PS1, etc.. are on the "Bash Section" and MANPAGER on the ...
0
votes
1answer
23 views

RHEL 7: Add PATH variables globally

Under my profile and the .bashrc file. I have added several environment variables. Example: export HADOOP_HOME=/app/hadoop-2.7.3 When I try to run any "hadoop" command I get command not found. ...
2
votes
2answers
199 views

New tmux session only sources .zshrc, and doesn't pick up the $PATH defined in .profile

After reading multiple questions on this topic I still feel lost. I read suggestions that one should set the environment variables including $PATH in .profile instead of specifically in .bashrc or ....
0
votes
0answers
11 views

Using different formats for export in .bashrc [duplicate]

When I check my ~/.bashrc files then sometimes I see entries like export LS_COLORS="di=01;94" and sometimes I see LS_COLORS="di=01;94" ; export LS_COLORS Is there any difference between these two ...
0
votes
3answers
40 views

I want to unset a list of bash variables that have their variable strings stored in an array

I'm working through creating a Dockerfile that calls on a script named start.sh I want to take the environment variables that are passed from the user either by means of docker-compose.yml or docker ...
0
votes
2answers
41 views

Add directory to all PATH-like variables [closed]

Is there a function that can add a root folder to all path-like variables? At the moment I use this function: function prepend_paths() { ROOT_PATH=$(readlink -f $1) export PATH=$ROOT_PATH/bin:...
0
votes
1answer
33 views

What's the purpose of having “env [shell]” as an interpreter? [duplicate]

I already stumbled over #!/usr/bin/env bash on numerous occasions and never questioned it. Now, I'm wondering what the purpose of wrapping the shell interpreter in an env command, i.e. why not just ...
0
votes
3answers
140 views

Env vars in /etc/environment not globally visible?

I am trying to create a systemd service; This service has a script that is supposed to use some environment variables; So I created this: cat /etc/systemd/system/atlantis-server.service [Service] ...
0
votes
2answers
43 views

environment variables script

There's several centos linux boxes at my workplace. I've been tasked with creating some form of environment variable tool for them. The idea is the user runs the tool, with the argument of their ...
0
votes
0answers
21 views

dynamically populate environment variable in cron? [duplicate]

Statically populating env variables works fine, but I need to populate an envvar with the date command. This works: ROOT=/the/script/dir LOG=/the/log/dir */5 * * * * $ROOT/dosomething.sh >...
1
vote
1answer
37 views

Program installation: Csh to Bash

I am trying to install xscore v1.3 (XSCORE MANUAL). They provide instructions to set up some environmental variables in the .cshrc file under C-shell. setenv XTOOL_HOME ...
0
votes
0answers
14 views

Using environment variables in directory names insde SLURM batch

I am using a cluster to run parallel SAS programs scheduled using SLURM. I would like to create directories in the scratch folder. I would like to create directories with unique names, so I was ...
0
votes
2answers
38 views

How to get the filename part of a path from a shell variable

A shell variable holds a path. How does one get its filename portion? In bash(1), I experimented and found that I can do it with ."${i/*\///}" where i is the name of the environment variable. Such a ...
1
vote
2answers
271 views

What environment variables/shell variables do env and printenv show [duplicate]

I have seen related questions such as this but they don't provide the exact answer to my question From my experiments as well as this answer, printenv and env pretty much show the same set of system ...