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

learn more… | top users | synonyms (1)

2
votes
3answers
53 views

Where does the TERM environment variable default get set?

When I open a terminal window with the GNOME Terminal emulator in the desktop GUI the shell TERM environment variable defaults to the value xterm. If I use CTL+ALT+F1 to switch to a console TTY ...
-1
votes
1answer
20 views

How do I set an environment variable in the shell to be result of python script? [duplicate]

If I run export TEST=script.py echo $TEST It outputs script.py script.py code: return 5 can TEST be set to 5? Obviously script will do something in future not just return a number
0
votes
1answer
23 views

How can I add default command line parameters to an executable in a way that will also work on GUI apps? [duplicate]

I want to pass a command line program by default when I run it. myprog --foo=bar The solution I could think of was to add a custom "myprog" wrapper to my "bin" folder #! /bin/sh /usr/bin/myprog ...
16
votes
1answer
265 views

Why does exporting vim as EDITOR in zsh disable keyboard shortcuts?

My .zshrc looks like this: export EDITOR="/usr/bin/vim" Now when I open a terminal and enter a keyboard shortcut like ctrla to go to the beginning of the line, it doesn't work. Instead, the string ...
3
votes
1answer
39 views

Bash Environment Variable Issue [closed]

We have a 3rd party scheduler that runs one of our job's shell scripts in bash. When the shell script is called, it sets the environment variables from the scheduler as $1, $2, $3, etc on the command ...
3
votes
1answer
38 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 ...
1
vote
1answer
23 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
163 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
759 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
37 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
51 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
19 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
32 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, ...
3
votes
3answers
55 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
81 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
42 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
24 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
120 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
72 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
49 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
33 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
56 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
29 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
32 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
69 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
39 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
55 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
19 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
33 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
55 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
61 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 ...
-4
votes
2answers
53 views

How do I print all env vars beginning with the letter 'T'?

This was an exercise for a course I'm on and I got really stuck at frustrated. I think my main problem is I keep putting the ">>" the wrong way round and then getting stuck in an editor which I don't ...
1
vote
1answer
34 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
59 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
76 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
88 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
45 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
136 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
112 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
65 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
752 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
296 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
34 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
235 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 ...