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

learn more… | top users | synonyms

3
votes
1answer
1k views

How do you make DISPLAY variable undefined?

I am using Ubuntu, but I think this applies to all Linux. What's the command to set DISPLAY to be undefined in the shell?
2
votes
1answer
1k views

How to run Steam from the Xfce desktop?

I've installed Steam on Debian 7.0 without any hassle, and I can run it by typing steam &. I've set it as a desktop launcher in Xfce, but when I ran it, nothing happened. Then I've check the ...
1
vote
2answers
617 views

OS X setting environment variables

I have OSX 10.8.2 with ZSH as my shell and iTerm as a terminal (don't know if the last thing is relevant). I have to mention that I'm relatively new to OSX. I'm trying to set up some environment ...
3
votes
2answers
2k views

Why isn't my environment variable visible from the command line?

I'm trying to run the James SMTP server on Lion (Mac OS X 10.7.2). When I do this: sudo JAVA_HOME=/Library/Java/Home ./james-2.3.2/bin/run.sh it works fine. However, I'd like to make JAVA_HOME an ...
0
votes
3answers
918 views

LANG environment variable not respected

OS: Mint13 I have set my preferred language to zh-cn via the language support option. This has changed the language of a small handful of things (synaptic, dates and times). However everything else ...
6
votes
2answers
271 views

What does the Enlightenment desktop (E17) environment variable “PANTS=ON” do?

Installing the Enlightenment Window Manager (E17), results in an environment variable being set: PANTS=ON What does this environment variable do? What will happen if I set PANTS=OFF
3
votes
1answer
243 views

Awesome: Incorrect timezone

Typically, I set the timezone of my computer's clock by changing the .bashrc file, appending, say, TZ='America/Los_Angeles'; export TZ such that whenever date is invoked the right time in the right ...
1
vote
1answer
226 views

Environment auto-install script

When I work, I often have to switch computers or virtual machines which means that every time I switch, I have to set up my (Linux) environment again. Is there a tool (in contrast to a simple bash ...
36
votes
2answers
3k views

$VAR vs ${VAR} and to quote or not to quote

I can write VAR=$VAR1 VAR=${VAR1} VAR="$VAR1" VAR="${VAR1}" the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?
2
votes
3answers
134 views

Bash - setting environment vars from bash invocation line

I'm looking for a way to manipulate some env var, which will be available for processes spawned by bash. Something like the below (of course, the syntax is not correct) /bin/bash VAR_X=2 and then ...
17
votes
1answer
3k views

Difference between environment variables and exported environment variables in bash

Bash seems to differentiate between variables which have been exported and those which have not. example: $ FOO=BAR $ env | grep FOO $ set | grep FOO FOO=BAR set sees the variable but env does ...
2
votes
3answers
4k views

Storing a list in a variable

I am trying to store the name of list of files that contain 781 in their name. I will be using this list to perform some operations and after that I will delete this list. I have two options to do ...
2
votes
3answers
844 views

What is the difference between '.' and 'source' in shells? [duplicate]

Possible Duplicate: running script with “. ” and with “source ” I have used both the dot command '.' and 'source' to reload a given rc file (typically to update my environment variables) ...
0
votes
1answer
357 views

difficalty to save traceroute output in shell variable?

I need to filter and store traceroute output in shell variable (array). But I am getting some unusual output. As I try to explain in following lines. My present directory is temp, having some ...
3
votes
2answers
800 views

Environment variable set but not respected

I find the following behavior a little confusing, can someone please explain why it happens? In /etc/bash.bashrc I have: EDITOR=vim And it is indeed set: lev@home ~ $ echo $EDITOR vim I would ...
5
votes
1answer
642 views

Difference between environment variable and shell variable

It is said that environment variables are inherited in child processes but shell variables are not. However the following test shows shell variables are seen in child process just as environment ...
2
votes
2answers
96 views

Can I change the shell used to run GUI applications from a Desktop Manager?

A bit of background I'm a developer and I install most of my tools in my home folder. So my shell's rc file is full of JAVA_HOME, GROOVY_HOME, MAVEN_HOME, ... variables. To expose all these ...
1
vote
0answers
37 views

Modify environment variable in a running process [duplicate]

Possible Duplicate: change environment of a running process Is there a trick to modify an environment variable in a running process? I need to add a repository at the end of PATH. I have ...
8
votes
2answers
630 views

Interactive shell with environment identical to cron

I am aware of a lot of pitfalls in the magic world of crontabs, but sometimes it would help troubleshooting a lot when you have some smart way to enter an interactive (bash) shell with exact identical ...
6
votes
3answers
14k views

How do I set an environment variable on the command line and have it appear in commands?

If I run export TEST=foo echo $TEST It outputs foo. If I run TEST=foo echo $TEST It does not. How can I get this functionality without using export or a script?
2
votes
1answer
103 views

Is there a way to define the preferred merge or diff tool under Unix?

I know that you can define the preferred editor by setting the EDITOR environment variable. My question is if there is a similar solution for setting the preferred merge or diff tool.
3
votes
0answers
118 views

tab-expansion and “./” bash shell [closed]

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The .bashrc and .bash_profile files are identical as the file structures on each machine is ...
2
votes
3answers
248 views

What is the difference between ./script and . ./script? [duplicate]

Possible Duplicate: Using ‘.’ to execute files in bash I was trying to figure out how to export my environmental via script instead of changing my .bashrc file. I found this old useful ...
4
votes
3answers
1k views

Bash shells with different environment variables

I want to somehow enter a different bash shell with some altered environment variables. For example, if I run script bfin.sh and it contains something like export PATH=/home/me/bfin2012:$PATH I ...
0
votes
1answer
849 views

Setting up enviroment variables in Ubuntu

I am trying to setup up my enviroment variable in my Ubuntu machine. Now i did some research and tryed the method on this question Set environment variable in Ubuntu Similar question but the thing is ...
4
votes
2answers
305 views

Inhibit Variable Expansion in Paths

How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example: $PREFIX/alt/li should expand to $PREFIX/alt/lib and not ...
4
votes
2answers
2k views

Change user and load entire environment in shell script

I'm having some trouble with an upstart script of ours that changes user and starts up a few ruby daemon processes. In the past i would simply bash -c "do the business" -l someuser making sure to use ...
3
votes
1answer
374 views

Environment settings on setuid executables

I am observing a curious behavior when running a program with setuid bit enabled. Program foo is owned by user bar with setuid bit set. User execbar runs foo foo reports that one of the dynamic ...
2
votes
2answers
1k views

Sharing Variables across sub shell scripts

I have a Main shell that runs a profile, The profile contains some variables such as Count. When I call the main shell, it loads the profile and then call another shell script. I want that inner shell ...
4
votes
2answers
8k views

How to export LD_LIBRARY_PATH to all users and system services

I want to export LD_LIBRARY_PATH to system services and all users. System services are run before login, so .bashrc is not applicable. How to achieve this?
3
votes
0answers
248 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
2answers
1k views

How to automatically add new path to $PATH variable after RPM packet installation?

I want to automatically add a new path to the $PATH variable each time when my RPM package is installed. I tried to use a post installation script in the my RPM. Here is the part of RPM spec file ...
0
votes
2answers
668 views

How to set environment variables permanently for one user [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) I have a user XX and I want to set the env variables for it. I looked for .bash_profile in the home ...
1
vote
1answer
1k views

Why .bash_profile couldn't set PS1 variable?

I set .bash_profile to exec env -i HOME=$HOME TERM=vt100 PS1='\h' /bin/bash But when I login, it also show: lfs@sam:~$ env TERM=vt100 PWD=/home/lfs ...
1
vote
1answer
71 views

Why lfs couldn't use original host environment variables?

From the lfs doc: The exec env -i.../bin/bash command in the .bash_profile replaces the running shell with a new one with a completely empty environment, except for the HOME, TERM, and ...
5
votes
1answer
2k views

How does 'screen' impact environment variables?

I noticed a difference in 'env' before and after a 'screen' call, is there any additional clarity on what gets called (for setting environment variables)? I couldn't see any clear explanation from ...
3
votes
2answers
966 views

How to change environment variables without re-logging to UI?

How can I change environment variables without re-logging to UI? I want to re/define some variables and want them set on my current logged in shell (including UI). I know logging out and then logging ...
10
votes
4answers
8k views

Script to change current directory (cd, pwd)

I want to run a script to simply change the current working directory: #!/bin/bash cd web/www/project But, after I run it, the current pwd remains unchanged! How can I do that?
6
votes
2answers
461 views

Run a script automatically as I switch to a directory [duplicate]

Possible Duplicate: Execute bash scripts on entering a directory I am running an environment which requires some very specific tool versions. The commands to set up the environment are in a ...
17
votes
2answers
10k views

How do I change the default text editor in the Debian (squeeze) distro

"Joe's own editor" does not come naturally to me. How do I change to using nano or vim? I've tried export EDITOR=nano but it doesn't seem to be respected. I'd like visudo to respect this as well.
2
votes
1answer
2k views

How can I set environment variable permanently through shell script?

Let's say I have a script: #!/bin/bash echo $1 if [[ ! $1 ]];then echo "True" fi export ABC="/home/aashish" ABC is not available after the execution of this script. How can I make that variable ...
1
vote
2answers
11k views

changing an environment variable like PATH forever [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) to change the amount of PATH variable , I use : export PATH=... but when I close the terminal, the ...
1
vote
1answer
166 views

crontab sets up user variable, redirect output, and detect connetcted network

I have three problem, all of them are about crontab. Can I access $HOME variable in crontab ? for example, use $HOME like this: PATH=$HOME/bin:$HOME/scripts:$PATH ? or * * * * * echo "test" > ...
2
votes
3answers
818 views

How can I restore the changes to shell variable?

For the purpose of an experiment... Suppose I did this bash="unset DISPLAY; export DISPLAY" so I can make DISPLAY undefined. How can I restore the original value set? Or at least know what it was? ...
2
votes
2answers
322 views

What is the difference between `terminator -e ranger` and ranger from terminal?

EDIT: I just noticed that when I hit Enter on the ranger (if it is executed with terminator -e ranger) then nano opens while with e it uses my main editor. In contrast, when I use a normal shell to ...
2
votes
2answers
321 views

How do you set an environment variable?

Please explain how to set environment variables. I need to point an environment variable to a xml file.
3
votes
1answer
243 views

Installing Texlive on PC-BSD 8.2

How can I install TexLive on PC-BSD 8.2 and set all the environment variables?
3
votes
2answers
1k views

sourcing a file inside a script

I'd like to source a file inside a tcsh script. In code: #!/bin/tcsh unsetenv LD_LIBRARY_PATH source $1 echo $LD_LIBRARY_PATH > temp_file The expected result: The environment variable set ...
7
votes
1answer
1k views

change environment of a running process

How might it be possible to alter some variable in the env of an already running process, for example through /proc/PID/environ? That "file" is read-only. Need to change or unset the DISPLAY variable ...
2
votes
3answers
904 views

FIrefox/Thunderbird storage locations

By default, Firefox and Thunderbird save their files to ~/.mozilla and ~/.thunderbird. I am wondering if there's an environment variable I can set, to have either of them save their data to a ...