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

learn more… | top users | synonyms

3
votes
1answer
32 views

Run a command in background that sets env var or define function

> export foo=1 & [1] 9016 [1] + done export foo=1 > echo $foo > I know when running a command with & you spawn a new process and the export foo=1 is not setting env vars in ...
-2
votes
1answer
23 views

autocomplete weirdness as a result of ugly hack for zsh prompt

I currently have the following line in my .zshrc: export PROMPT=$(printf "\e[38;5;6m")%m$(printf "\e[m")%d-%h:" " Which is supposed to show the hostname in blue and history and current working ...
1
vote
1answer
22 views

Setting environment vars containing space with env

I'm trying to use env to set environment variables (read from another source, say for example a file) for a subprocess. Essentially, I am attempting the following: env VALUE=thisisatest ...
3
votes
3answers
159 views

Environment variables. Where are they saved in? [duplicate]

If I do not edit the .bashrc or other config files, the environment variables that I've setted are gone when I logout, or turn off the terminal. What I'm curious is, where are those 'temporary' env ...
0
votes
0answers
19 views

Why does not changing changing LC_ALL from utf to C speed up my grep?

I wanted to try to speed up my already fast grep. I read that changing lc_all from utf to c was supposed to do this. However, it gives no speedup. What might the reasons be? How do I "debug" this? ...
11
votes
2answers
749 views

What is DISPLAY=:0?

What is DISPLAY=:0 and what does it mean? It isn't a command, is it? (gnome-panel is a command.) DISPLAY=:0 gnome-panel
3
votes
1answer
35 views

Question on environmental variable

I have Oracle jdk7 installed on my centos6. I noticed that the /etc/profile has the lines below: #below lines are added for Java export JAVA_HOME="/usr/java/latest" ## export JAVA_HOME JDK ## export ...
0
votes
2answers
49 views

What is the variable of $#?

I'm learning introductory Linux and came across something which I did not understand: "The following command has been executed: set 10 20 30 40 50 Enter the value of the variable $#: I understand ...
0
votes
1answer
17 views

Linux environment variable using non-fullpath

I'm setting the environment variable LD_PRELOAD to a shared library file I created, in order to let LD_PRELOAD to point to my created shared library file, I need to give the full path like this: ...
1
vote
1answer
25 views

Loading .profile from .bash_profile or not using bash_profile at all? [duplicate]

I am on a MAC running Yosemite. Until recently, I only had a .profile, in which I added directories to my PATH. Now I have a .bash_profile, which from what I experienced and later read online, ...
2
votes
1answer
35 views

Is there a nice way to set directory/project local environment variables?

I have been working on several projects and they require different environment variables (e.g., PATH for different versions of clang executables, PYTHONPATH for several external modules). Whenever I ...
1
vote
1answer
48 views

Optimal way to set and read variables

I need to set 6 variables which are used by several services and applications in Linux. I have so far been using the environment variables, but find it very complicating to modify these variables ...
0
votes
1answer
31 views

Exporting a piped command without evaluating output?

I'm trying to set an export that would effectively kill a process based on the PID that pgrep feeds it. Running the command kill $(pgrep myAppName) appears to work (if 'myAppName' were the name of an ...
0
votes
0answers
47 views

How do I get Ubuntu to use Anaconda's python instead of the standard /usr/lib/python…?

I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: http://askubuntu.com/questions/505919/installing-anaconda-python-on-ubuntu ...
0
votes
2answers
35 views

Why doesn't `sudo su -l -c “java”` work even though `sudo su -l -c “echo $PATH”` displays the location of the java binary? [duplicate]

I have a server with Java binaries from a tarball on a custom location, and the following in /etc/bash.bashrc: export JAVA_HOME=/path/to/java/home export PATH=$JAVA_HOME/bin:$PATH When I run sudo ...
0
votes
1answer
23 views

Why doesn't commons-daemon ./configure recognize $JAVA_HOME? [closed]

I'm trying to install a tomcat 7 server. I'm following these instructions from the tomcat 7 docs. I also set my JAVA_HOME variable in ~/bashrc as well as ~/.bash_profile and /etc/profile. I can do ...
1
vote
4answers
118 views

bash division of numbers in text file

I have two numbers in test.txt file, I would like a way to divide the second number by the first number and assign the result to a variable or file in a bash script that I can use. I have used awk ...
1
vote
1answer
69 views

Environment Variables not getting set in bash_profile

I have my bash_profile environment setting as follows: if [ `hostname` = "devoraebs01" ]; then echo `hostname -f` . /appl_top/deverp/appl/APPSDEVERP_devoraebs01.env When I log into this host, ...
2
votes
2answers
45 views

Is shell parent of all the processes in linux

I have been trying to understand shell scopes and environment in depth. I have been reading about how if we do export VARIABLE=VALUE it will be available in subshell. So I wanted to ask a question I ...
1
vote
2answers
26 views

tcsh: make 2-digit hours in prompt

I am attempting to simply get a standard lexigraphical time display in the prompt and the history file in the range of 00:00:00 to 23:59:59. I've tried set prompt=%P$ but this just produces, for ...
2
votes
1answer
31 views

Running a constructed command from bash script

I constructed a command like this in a bash script a="my_cmd"; a="$a --verbose"; echo $a; $a; It works and executes my command correctly. But when I add an environment variable to the mix it ...
1
vote
1answer
39 views

When did bash quit exporting SHELL?

I upgraded a Debian box from stable to Jessie and I noticed that SHELL is no longer exported, so screen and similar programs start dash for subshells instead of bash. When was this change made and ...
1
vote
1answer
52 views

su or sudo keeping/removing certain environment variables

I would like to be able to log in as another user and keep most, but not all of my environment. Specifically, I would like to set $HOME to the correct value for the new user, but keep probably ...
1
vote
2answers
28 views

Does X mangle prompt environment variables?

I'm starting it with startx. Before that I have PS1 in my environment: $ cat /proc/self/environ | tr '\0' '\n' | egrep '^PS' PS1=[\u@\H \w] PS3=> PS2=> PS4=+ From inside X I get: $ cat ...
1
vote
1answer
31 views

How can I consistently set an environment variable for a single program?

I'm using LC_TIME="en_AU.UTF-8" in general, and I'm happy with that. However, when I use Thunderbird, I'd like it to use a 12-hour clock. I've created a custom locale, and it works fine if I launch ...
0
votes
0answers
59 views

Possible to pass env vars into chpst without envdir?

I use runit to daemonize my web application, and I'm trying to see if I can have my process managed by sv not have to have a corresponding envdir for its environment variables. I wonder if I can just ...
1
vote
0answers
38 views

What does CRON=1 do?

What does setting CRON=1 do when set in front of a command? CRON=1 ./foobar.sh I suspect that the cron environment variable does something for printing to standard out. But I can't find anything ...
2
votes
3answers
54 views

Controlling the environ passed to child process by bash

I am using x86_64 GNU/Linux with bash #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { system("set > setc"); // A subset of `$ ...
2
votes
0answers
18 views

Configure where GRUB2 environment block is located

I have Arch, Ubuntu, and GRUB2 installed on a BTRFS filesystem. I'm aware that GRUB cannot write to BTRFS for a variety of good reasons, and therefore cannot save environment variables to ...
1
vote
0answers
32 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 ...
0
votes
0answers
48 views

Set Environment Variable for Ranger File Manager

I've recently stumbled across ranger file manager and immediately took a liking to it. However, there is still a problem I couldn't figure out the solution to: How is it possible to change environment ...
2
votes
2answers
60 views

The 'LANGUAGE' locale variable - how to set English as primary language? A bug in gettext?

The "LANGUAGE" variable is supposed to set the default language and can be used to specify a set of languages, where the next language will be used if a message is not available in the first ...
1
vote
1answer
33 views

$USER not set ssh

On some of my debian wheezy servers there is a global variable $USER that contains the current logged in username and on some this variable is not set immediately at login. How do I set $USER so it ...
1
vote
2answers
56 views

Do programs source .bashrc when run?

I append to my PATH environment variable in my .bashrc file (Ubuntu v12). I also have a service (Atlassian Bamboo) that relies on the modifications to PATH. When I restart the service (which runs as ...
0
votes
1answer
70 views

make custom commands on android 4.4.2

I want to program and debug in my android phone. To do that I downloaded c4droid and it's gcc plugin. after a lot of tries I understood that gcc is in directory ...
5
votes
2answers
60 views

Introduction of env --null

I have tried to extract environment variables in a Python process with help of env --null, which works even for environment variables containing newline character. But on some machines I have ...
3
votes
2answers
82 views

Unsetting environment variable with an empty name

For some reason, my system sets an environment variable with no name. This can be seen in the output from printenv as a line containing only = and causes problems for Python (more specifically the ...
0
votes
1answer
40 views

How does sudo -E work here?

I executed the following command to add a ppa repository in Ubuntu: sudo add-apt-repository ppa:ppaname/ppa This command returned an error that the ppa name format is not correct. Then I looked here ...
1
vote
2answers
122 views

Makefile make install not executing multiple line commands

I have a Makefile that contains an install section to allow me to make install after building the source code. The install section contains two lines of shell commands: install: /usr/local/lib cp ...
2
votes
0answers
110 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 ...
2
votes
1answer
63 views

Executable cannot be found

I installed gradle in /opt/gradle-2.2.1 I edited /etc/environment to look like this GRADLE_HOME="/opt/gradle-2.2.1" ...
2
votes
2answers
600 views

sudo as another user with their environment

$ whoami admin $ sudo -S -u otheruser whoami otheruser $ sudo -S -u otheruser /bin/bash -l -c 'echo $HOME' /home/admin Why isn't $HOME being set to /home/otheruser even though bash is invoked as ...
0
votes
1answer
268 views

Please set env variable CHROME_BIN

> node node_modules/karma/bin/karma start test/karma.conf.js INFO [karma]: Karma v0.12.30 server started at http://localhost:9876/ INFO [launcher]: Starting browser Chrome ERROR [launcher]: Cannot ...
3
votes
1answer
33 views

Protecting process's envvars from exposure

From I've read about current best practices for developing web applications (such as the Twelve Factor guide), the recommended approach for storing configuration data is within environment variables. ...
4
votes
2answers
214 views

Share environment variables between bash and fish

bash and fish scripts are not compatible, but I would like to have a file that defines some some environment variables to be initialized by both bash and fish. My proposed solution is defining a ...
8
votes
3answers
365 views

How can I list all shell variables?

Reading about this question: In zsh how can I list all the environment variables?, I wondered, how can I list all the shell variables? Also, does the distinction between shell variables and ...
0
votes
1answer
29 views

how to export nam of logged in user correctly?

I have the following script here. #!/bin/bash #some initial variables DLURL=https://raw.github.com/horvan/drubuntu/master DIRURL=/opt/.drubuntu #Get files to run the installation wget -O ...
3
votes
2answers
359 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 - ...
3
votes
2answers
766 views

What is $PWD? (vs current working directory)

So Wikipedia (link) tells me that the command pwd is short for "print working directory", and that makes sense. But for the environment variable, the "P" has to be an acronym for something else than ...
1
vote
1answer
249 views

systemd: default value for environment variable

I would like to migrate some OpenRC init script to systemd but I think that it is general problem of environment variables handling in systemd. Original OpenRC files There is a file e.g. ...