A set of dynamic variables that can affect the running processes.

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

Setting the LANG environment variable for xfce

I am on a multi user Debian Stretch system which has en_US.UTF-8 as default locale, but I want de_DE.UTF-8 for my user. I was able to set it for terminals, by adding export LANG=de_DE.UTF-8 to ...
4
votes
1answer
806 views

Inherit environment variables in systemd Docker container

I have a Docker container running systemd. I want to pass environment variables to applications under it. When I start systemd from within Docker (/sbin/init as command line), Docker exposes ...
2
votes
2answers
24 views

Why does .pam_environment not include $HOME in my new path?

I created a /home/myname/.pam_environment file containing PATH DEFAULT=${PATH}:${HOME}/apps/flyway But my new path doesn't end with /home/myname/apps/flyway. Why not? $ echo $PATH ...
65
votes
4answers
7k views

Alternative to .bashrc

Is ~/.bashrc the only place where I can specify user specific ENV Variables, aliases, modifications to PATH variable, etc? I ask because it seems that ~/.bashrc would be BASH only...
5
votes
1answer
936 views

Locale environment variable settings do not take effect

I have a Debian 6 (64-bit) VPS where I cannot seem to get the locale environment variables LANG and LC_* set. (Everything below as root). vps:~# locale -a C POSIX en_US.utf8 nl_NL.utf8 vps:~# locale ...
42
votes
3answers
15k views

How does /usr/bin/env know which program to use?

When I use the shebang #!/usr/bin/env python to run a script, how does the system know which python to use? if I look for a python bin path in the environment variables I find nothing. env | grep -i ...
1
vote
2answers
407 views

Configure tmux to use zsh

Right now I have my iTerm session configured to use zsh (/usr/local/bin/zsh), but I'm trying to configure tmux to use zsh as well, instead of /bin/bash/, which it's currently defaulting to. So far ...
0
votes
1answer
786 views

How to specify a custom include directory in Debian?

I am trying to compile my program on a Debian system via ssh and without root privileges. PRETTY_NAME="Debian GNU/Linux 7 (wheezy)" NAME="Debian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" I ...
0
votes
2answers
43 views

Correct way to set PERMANENT environment variables from script

I want to do a very simple install process for my app framework. I've got everything working, but I want to set two environment variables. I want to update the PATH and also set a HOME variable. I ...
0
votes
0answers
11 views

Run VNC at startup as root - HOME variable not being set

I have the following code in /etc/init/vnc.conf (used by Ubuntu 14.04's Upstart): description "VNC on start" author "user129013" start on runlevel [2345] exec /root/vnc The job is running ...
0
votes
2answers
39 views

bash command to print gcc environment variables

Is there a way to print all the GCC environment variables(path for include directory, library) from the command line, i.e something similar to 'printenv' that gives all bash environment variables ?
0
votes
2answers
26 views

$USER environment variable not changed to root

The USER env variable is unchanged after gaining root access. [user1@comp]$ echo $USER user1 Logged in the system as 'user1'. Now check the output after gaining root access. [user1@comp]$ su ...
3
votes
2answers
71 views

Why is #!/usr/bin/env bash not working on my system?

I ran into some issues when running some installation scripts where they complained of bad interpreter. So I made a trivial example but I can't figure out what the problem is, see below. ...
0
votes
1answer
2k views

Runtime parameters for a systemd service

I am a little confused about how runtime parameters are normally supplied to a systemd service. The general idea I have is that the following happens: There is a file that contains the environment ...
0
votes
0answers
15 views

How to edit $PATH? [duplicate]

After searching, I can't still figure out how to edit $PATH. Now its value is: ...
0
votes
1answer
14 views

bash: /home/hadoopuser/hadoop/sbin: Is a directory

I am in Ubuntu 14.04 LTS. Based on how to set a Hadoop cluster I am executing this: # Add Hadoop bin and sbin directory to PATH export PATH=$PATH:$HADOOP_HOME/bin;$HADOOP_HOME/sbin where I know ...
0
votes
1answer
1k views

Installing netbeans on Scientific Linux- NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread “main”

I'm installing netbeans 8.0.1 on Scientific Linux. I have executed the installer .sh but I get the error: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main" ...
3
votes
1answer
1k views

How to set the path OSX applications use

I'm running Mountain Lion 10.8.4, and have my environment all customized through ~/.profile so that when I run GUI apps like Sublime Text or Eclipse from the command line open /Applications/Sublime\ ...
1
vote
0answers
20 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
35 views

Setting environment variable using shell script

I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables. |----SCRIPT 1---| |----SCRIPT ...
0
votes
0answers
9 views

Export variable failed when I was compiling NETCDF

I'm compiling NETCDF on Linux. After configure, make,make install, I have already install NETCDF on /disk3/lly/lib/netcdf-4.1.3. Then, using vim ~/.bashrc,edit: export ...
23
votes
2answers
6k views

How do I start all shell sessions in a directory other than $HOME?

When I open my non-login shell in Ubuntu, my present working directory is /home/user_name (my $HOME environment variable), but I want to change this such that when I start my terminal I am in some ...
7
votes
5answers
637 views

PATH environment variable in linux [duplicate]

I want to know how the standard environment variables given by the linux OS like PATH, HOME are set automatically. In which file are these read from. There should be some file from which these ...
6
votes
1answer
470 views

What is a *.sorted command and why doesn't it work in my bash?

In a Bash Guide for Beginners (sec. 3.2.1.2. Local variables) there is an example command which is supposed to list all of the local variables, that are not in enviromental variables, or so I think: ...
12
votes
3answers
4k views

What is the difference between 'env' and 'printenv'?

What is the difference between the two commands env and printenv? They both show the environment variables, and the output is exactly the same aside from _. Are there any historical reasons for there ...
331
votes
7answers
590k views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this. This way: export ...
1
vote
1answer
45 views

Setting env variable through script on current session

Is there a possible way of setting env variable through script on current session. I have tried source option. But this works on the shell not through script. here is my script content source ...
6
votes
3answers
184 views

How can I un-export a variable, without losing its value?

Let's say I exported a variable: foo=bar export foo Now, I'd like to un-export it. That's to say, if I do sh -c 'echo "$foo"' I shouldn't get bar. foo shouldn't show up in sh -c's environment at ...
8
votes
2answers
141 views

Variable assignments affect present running shell

While writing some code I found out that this line: $ TZ="America/Los_Angeles" date; echo "$TZ" Thu Dec 24 14:39:15 PST 2015 Correctly gives the actual time at "Los Angeles" and that the ...
3
votes
1answer
816 views

How to set environment variables under MATE?

I have just installed MATE under Ubuntu Saucy. No problems. Except I am trying to setup Texmaker, the LaTeX IDE, and cannot figure out how to set the paths to the LaTeX tools (pdflatex, etc.) which ...
3
votes
1answer
34 views

How bash changes environmental variables on-the-fly?

As we know, it's only possible to change the environmental variable set of a process in some time after the fork() system call and before exec(), e.g. manipulation like this is possible only from ...
3
votes
3answers
2k views

forward function and variables into sudo su - <user> <<EOF

I have declared functions and variables in bash/ksh and I need to forward them into sudo su - {user} << EOF: #!/bin/bash log_f() { echo "LOG line: $@" } extVAR="yourName" sudo su - ...
2
votes
2answers
7k views

Set global environment variables at boot in Solaris 11

I am wanting to create a file in Solaris, so that I can export a few "items" whenever the machine is started up. i.e. I want to export ORACLE_HOME and ORACLE_SID and some other directories, of my ...
2
votes
3answers
139 views

get environment variable by variable name? [duplicate]

For example, I have a variable: env_name="GOPATH" Now I want to get the environment variable GOPATH as if like this: echo $GOPATH How can I get $GOPATH by $env_name?
14
votes
6answers
11k views

Why are PATH variables different when running via sudo and su?

On my fedora VM, when running with my user account I have /usr/local/bin in my path: [justin@justin-fedora12 ~]$ env | grep PATH ...
5
votes
3answers
5k views

how to pass environment variable to sudo su

I basically need to do this: DUMMY=dummy sudo su - ec2-user -c 'echo $DUMMY' This doesnt work. How can I pass the env variable $DUMMY to su? -p doesnt work with -l.
2
votes
2answers
37 views

several virtual profiles for the same user

Many times there are several "identities" which one user uses: for work, open-source, academia etc., all require different ssh keys, editor configurations, git configs etc. I was wondering if there ...
6
votes
1answer
87 views

Strange environment variable !::=::\ in Cygwin

Using Cygwin, I installed Environment Modules by downloading source code, running configure, make, and make install. Every time I run a module command, I get: init.c(718):WARN:165: Cannot set TCL ...
6
votes
4answers
274 views

Assign multiple environment variables to a single variable and expand them on command

Let's say I want to repeat the same string of environment variables before running various incantations of a command if [[ some_thing ]]; then TZ=GMT LC_ALL=C LONG_ENV_VAR=foo my_command elif [[ ...
1
vote
1answer
19 views

Programs don't see fish environment variables

If I set the EDITOR environment variable to emacs in bash, running crontab -e will open the crontab in emacs. When I set it in fish with set -U EDITOR emacs crontab opens with vim. What can I do ...
0
votes
0answers
17 views

How to make versions consistent

I'm using OS X 10.10, and IIRC I've installed bash and other GNU utilities using brew. The output of which bash is /usr/local/bin/bash, and it's version is 4.3, however the env variable SHELL points ...
1
vote
1answer
73 views

How to print the total available space percentage on a specific file system in both linux and solaris?

I've searched for an answer to this question and I found that this command: df /dev/sda1 | awk {print '{(100 -$5 )}' | tail -1 | sed '/s/$/%/g' does the job pretty well on my linux system but I ...
1
vote
1answer
65 views

can one use script commands in systemd Environment field?

I've got a docker-compose file that I use to start up several containers for my service. One of these containers requires an environmental variable to be set (the public ip of the server, to be ...
1
vote
0answers
27 views

Tmux has different environment variables? [closed]

I'm on a RHEL 6 system and I recently noticed I was running into proxy issues when running commands in tmux. When I echo $HTTP_PROXY in tmux, I get nothing. But, if I open a terminal on its own ...
4
votes
1answer
42 views

Is there a way of setting the library search path temporarily

We deploy our application with all the necessary dependencies in one directory. Our application sets LD_LIBRARY_PATH to this location. Some of the libraries (for instance OpenSSL) are also present at ...
35
votes
7answers
11k views

How to determine where an environment variable came from

I have a linux instance that I set up some time ago. When I fire it up and log in as root there are some environment variables that I set up but I can't remember or find where they came from. I've ...
3
votes
4answers
43 views

Bash command substition with environmental variable

I have this code in bash #!/usr/bin/env bash DB_NAME=$(CORE_CONFIG=core.config.core_test python -c "from core import config; print config.DATABASE['db_name']") What I actually want is: ...
1
vote
1answer
30 views

Relation between shell start up processes and environment of parent process

"How are shell variables related to the environment that a process started by the shell has on start-up?" I read If processes inherit the parent's environment, why do we need export? My current ...
0
votes
0answers
12 views

Supervisord fails to run a program

I've a program that I try to run with supervisord but keep failing. The following is supervisord configuration: $ cat /etc/supervisor/conf.d/application.conf [program:application-web-1] command=env ...
0
votes
0answers
31 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 ...