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.

5
votes
0answers
2k views

Raise 128KiB limit on environment variables in Linux

Linux seems to have a default limit of 128KiB (131072) on the length of any single environment variable -- any attempt to set an envvar longer than this and then run any program will result in an '...
5
votes
0answers
225 views

Is it possible to make an exec call that “returns”?

Is there a way to make the exec system call work like a function call that returns instead of totally replacing the current process image? My motivation is trying to integrate two shells with ...
4
votes
0answers
483 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 ...
4
votes
0answers
161 views

Exported bash functions sometimes visible from Perl

My Redhat 9, OpenBSD 4.9, FreeBSD 10, Macos X, LinuxMint 17.3, and Ubuntu 14.04.4 all print OK when running this: myfunc() { echo OK; } export -f myfunc perl -e open\(\$fh,\"\|-\",\"@ARGV\"\)\;close\$...
3
votes
0answers
131 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 ...
3
votes
0answers
511 views

Global Environment Variables for Users & systemd

I have a set of environment variables that I need to be globally set for all users and all systemd services. I don't want to have to specify them it two different locations. I tried setting them /...
3
votes
0answers
4k views

Custom GCC installation - how should I set my environment variables?

After some pains I was finally able to build me a gcc 4.9.3 (I don't have root on the machine I'm working on, and Fedora 22 doesn't package gcc 4.9 anyway). And it even works, i.e. using it to compile ...
3
votes
0answers
1k views

Debian ignores PAM env variables (while Arch doesn't)

I have a weird issue with my Debian Sid system. I want to set a global environment variable in /etc/environment, which is supposed to be read by the pam_env module. Unfortunately, after having relogin ...
3
votes
0answers
1k views

Reading from /etc/environment with sudo

Using Ubuntu 14.04 LTS, I'm having a problem trying to read environment variables from /etc/environment when using sudo env. Basically, they are not being displayed. When I do just env, these ...
3
votes
0answers
631 views

assigning a multiline variable (tcsh prompt) to another

For tcsh, I have a prompt that is multiline: set prompt = "%/\\ %n@%m[%h]% " This shows the cwd on one line and then the user/host on second line. However, with this, I cannot make a copy of that: ...
2
votes
0answers
51 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/...
2
votes
0answers
115 views

Issue setting environmental variable in tmux and screen

Whenever I use Tensorflow (a python library) from within a tmux or screen session, I have to manually change the environmental variables. Specifically, I have to type export PATH blah blah blah and ...
2
votes
0answers
67 views

modprobe in setuid contextmodprobe in setuid context

In CVE-2017-0358, author notes that The issue is that /sbin/modprobe is not designed to run in a setuid context. As the manpage of modprobe explicitly points out The MODPROBE_OPTIONS environment ...
2
votes
0answers
116 views

How to explicitly set the tabname of a new gnome-terminal?

I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed ...
2
votes
0answers
135 views

Is there a plugin or tool for multiple “profiles” in ZSH?

I use oh-my-zsh for all of my console goodness. Depending on what I'm working on, there are certain environment variables that I'm often overwriting either manually or through scripts to make my work ...
2
votes
0answers
88 views

Envirnment variables for packages built in custom location

Some time ago (month or so) I started to install packages that I build from source in custom location ~/.local so that I can easily distinguish which I build from source, and for other reasons, ...
1
vote
0answers
30 views

Ruby script is not picking up sourced env vars

I am using environment variables in a Ruby script. When I export the variables and run the script as follows, it works fine. export ELK_URL="https://localhost:3241" ruby ./my_script.rb The contents ...
1
vote
0answers
64 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 ...
1
vote
0answers
47 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 ...
1
vote
0answers
59 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.
1
vote
0answers
31 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 ...
1
vote
0answers
59 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 ...
1
vote
0answers
62 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" "/...
1
vote
0answers
44 views

Passing environment variables via sudo on solaris 10

I need to execute a command via sudo on Solaris 10, and I need to pass two environment variables to the command. This must be done in /bin/sh, not bash, not ksh. This is possible on Linux, serveral ...
1
vote
0answers
722 views

How do you permanently add include and library paths to ubuntu?

I have added the following environment variables to the end of my bash.bashrc CPATH=$CPATH:/usr/custom/include LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/custom/lib PATH=$PATH:/usr/custom/bin But when ...
1
vote
0answers
2k views

Permanently set environmental variables in /home/user/.profile

I have this issue. It will be appreciated all your ideas. I need to set some environmental variables permanently for a user. I tried to edit /home/user/.profile, but it doesn't load when I log in. I'm ...
1
vote
0answers
192 views

Compiling Octave: how to add a new item to the include directories for Qt?

Situation My distro is Ubuntu 14.04. I am installing Octave 4.2.1. I have a shell script doing this for me using GNU make. Octave is in search of Qt libraries. I wish to use the Qt5 5.8 binaries ...
1
vote
0answers
51 views

On making the environment depend on the current directory

I think it would be useful/convenient if the current directory determined one's shell environment. This would mean that the command cd /my/projects/foo ..., for example, would not only set the ...
1
vote
0answers
27 views

What is the standard approach for shared home directories for a user across multiple machines?

This is kind of a two-part question. In the case where there are multiple machines for which users get a single home directory - i.e. sshing into any of the machines, a user will find the same files ...
1
vote
0answers
298 views

Arch Linux with Mate ignores exports in ~/.bash_profile and ~/.profile

I use Arch Linux and need to add environment variables on login. I have Plasma, Cinnamon and Mate installed. For some reason the environment variables in ~/.profile and ~/.bash_profile are not set ...
1
vote
0answers
92 views

Master environment script based on $LOGNAME to run on any shell invocation

Dealing with a nice list of Linux (and Solaris) servers, I find that 90% of my users need the same environment variables with a few specifics unique for an individual user. My goal is to eliminate ...
1
vote
0answers
170 views

Piping to 'tee' commands prevents changes in environment variables

I have a csh script using which I modify certain environment variables and echo values of these environment variables from within this script. I source this from another script: source "$...
1
vote
0answers
1k views

$PATH variable on Fish Shell OS X

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? user@host ~> more ~/.config/fish/config.fish set -g -x PATH /usr/local/...
1
vote
0answers
325 views

How to set environment variable for BACI compiler and interpreter?

I have installed executable files for BACI compiler and interpreter in my Ubuntu system. But now every time I have to compile my .cm file I have to go to the program folder and run ./bacc and ./...
1
vote
0answers
162 views

export -f in .bashrc after upgrade to bash 4.3.30 kills builtins?

I recently upgraded my bash (Mac OS X 10.6.8) from 3.2.48(1) to 4.3.30(1) via macports, and while the install seems to have gone smoothly, the two spots in my ~/.bashrc where I had export -f myfunc; ...
1
vote
0answers
413 views

Setting XDG_DATA_HOME and XDG_CONFIG_HOME on compile/per program

The goal is to have a -dev version and a stable repository-based version installed at the same time, but with different data and config directories so that the dev version is not operating on(and ...
1
vote
0answers
124 views

Programmatically obtain LILYPOND_DATADIR for execlp() call

I wrote an application that calls lilypond by execlp()ing it. However, when my app executes this line, the following error occurs: GNU LilyPond 2.16.2 warning: not relocating, no 2.16.2/ or current/ ...
1
vote
0answers
357 views

Setting environment variables at runtime in KDE4

Is it possible to set an environment variable at runtime, affecting all the programs started from the DE after that point (Desktop Environment, in my case KDE4) (without rebooting)? I know it it ...
0
votes
0answers
33 views

Knowing what directory a process started in

I'd like to be able to know mid-working what directory a child process started in. Here I'm in a Bash session, I start a dash session and I'd like to know where did dash start (in the example it ...
0
votes
0answers
11 views

Gnome3 Session Startup File

What is the location of the "Gnome3 Session Startup File". I use Ubuntu 18.04 with gdm3 as display manager. I want to export an environment variable (persistent) for GUI (desktop) application. Also,...
0
votes
0answers
40 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
0answers
27 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 ...
0
votes
0answers
12 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
0answers
54 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=...
0
votes
0answers
55 views

Get the normal $PATH when calling it in a subshell

How could I call the $PATH variable in a subshell, such that I get the result I would in the normal shell? [ec2-user@ip-172-31-45-160 ~]$ echo $PATH /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/...
0
votes
0answers
50 views

hitachi SNM2 CLI issue

I have installed linux ver of HSNM2 on a server. There seems to be a problem reg env variables. I am not able to figure, it looks simple and confusing. root@server:/usr/stonavm$ cat setup_env.sh ...
0
votes
0answers
546 views

What does setting no_proxy to comma seperated 0-9 mean?

I understand that ip addresses and host names put under no_proxy are going to be accessed without going through a proxy. What is no_proxy=0,1,2,3,4,5,6,7,8,9 supposed to mean though?
0
votes
0answers
148 views

How to set environment variables to path so it can be read from GUI and command line from the same program?

I installed texlive and I want to add it as an environment variable to my Path so that Emacs AucTeX can read it when I start emacs from the GUI or from the command line. So far I've read that emacs ...
0
votes
0answers
28 views

Create shell with restricted amount of binaries

during software build I would like to restrict/control the binaries available to the build process. My plan was to make a directory BUILD_PATH which I populate with symlinks to the actual binaries; e....