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

learn more… | top users | synonyms

2
votes
2answers
1k views

How can I keep *all* environment vars for a specific command in sudo?

I have a script that sets several environment variables and then finally calls another script using sudo. The script run with sudo must be able to pick up those variables, and I'm not always going to ...
4
votes
1answer
193 views

Setting user environment variable permanently, outside shell?

Is it possible to set up an envinronment variable that can be accessible from any shell, not an specific one, and that doesn't decay as soon as your session ends? I'd like to set up a NODE_ENV ...
6
votes
5answers
2k views

How is sudo set to not change $HOME in Ubuntu and how to disable this behavior?

On Ubuntu 12.04, when I sudo -s the $HOME variable is not changed, so if my regular user is regularuser, the situation goes like this: $ cd $ pwd /home/regularuser $ sudo -s # cd # pwd ...
34
votes
4answers
1k views

What exactly is an environment variable?

I know that VARIABLE=value creates an environment variable, and export VARIABLE=value makes it available to processes created by the current shell. env shows the current environment variables, but ...
2
votes
1answer
1k views

bash: export: `--wait': not a valid identifier

When I run git-sh from my terminal it works fine. But I get the following warning. bash: export: `--wait': not a valid identifier What is this and how do I get rid of it?
2
votes
1answer
3k views

How to set Oracle Java's JAVA_HOME in Fedora 19

I just installed Fedora 19 and managed to get FedoraUtils installed. So I chose java oracle. after installation I could see in the FedoraUtils list that oracle java (installed) but I can't see the ...
2
votes
1answer
166 views

Screen - inherit current window's environment

In GNU Screen, how can I create a new window whose shell inherits the environment of the shell in the current window? The usual Ctrl+A C doesn't seem to do this.
3
votes
1answer
290 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\ ...
8
votes
2answers
593 views

What's the best distro/shell-agnostic way to set environment variables?

The question says it all. I currently use Arch Linux and the zsh, but I'd like a solution that (at minimum) works both on VTs and in xterms and also (hopefully, preferably) will continue to work if I ...
27
votes
3answers
12k views

What does “LC_ALL=C” do?

What does the C value for LC_ALL do in Unix-like systems? I know that it forces the same locale for all aspects but what does C do?
4
votes
7answers
845 views

how to share environment variables between shells like globals related to a master pid?

So, I need to share environment variables between shells, and that the changes on the variables be promptly recognized by all shells, like global variables. But they must be related to a master pid, ...
1
vote
1answer
133 views

Why does export not seems to affect child shells?

if I have $ x='This is a String' $ export x $ xterm & [3] 14089 The child process doesn't seem to respond to $echo $x $ Update: The FIRST time I export the variable it seems to span a ...
3
votes
2answers
225 views

Which Debian package does /etc/environment come from?

I know that /etc/profile is installed by base-files, but it doesn't look like this package installs /etc/environment: $ dpkg -S /etc/environment dpkg-query: no path found matching pattern ...
2
votes
1answer
8k views

bash setenv command is not found

every body I am new in centos server I am getting a error while using following command setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH error is bash setenv ...
0
votes
2answers
194 views

gmrun stopped searching user added path

gmrun started ignoring the PATH variable I defined in ~/.bashrc for no obvious reason. Anyone has any idea how I can find out a way to solve this annoying problem? EDIT I have not found the ...
2
votes
2answers
276 views

How to source correct startup scripts on interactive, non-login shell

I'm trying to set up a sane/usable environment in a barebones OpenSolaris-derivative (OmniOS, a distribution of Illumos/OpenIndiana). I have all the plumbing code I need in .profile, .inputrc, and ...
0
votes
3answers
381 views

TERM variable in chroot

I've created a chroot with the help of jailkit and now I'm trying to install some other libraries and tools. First I tried to install clear library. I've copied the file from the /bin folder and ...
3
votes
2answers
285 views

Setting environment variables for system users

I have a couple of system users that have no password set, login disabled and no home directories. They are used solely to run FastCGI processes for a couple of websites. I want to avoid hard coding ...
3
votes
2answers
143 views

Current environmental variables of a process

This question relates to this answer. Is it possible to get the current (not initial) environmental variables of a process by making a child process and checking its initial environmental variables? ...
2
votes
2answers
95 views

How to get environmental variables of a very short process?

I have a very short process for which i want to check the environmental variables for debugging purposes. The process is instant from a human perspective. The example illustrates it better. Example ...
6
votes
3answers
1k views

How do I set the PATH or other environment variables so that X apps can access it?

How can I set env variables so that KDE recognizes them? How do you set the path in a non-shell environment (KDE)? Unlike the above two questions, I want to know how to do this for GNOME. Or better ...
19
votes
3answers
791 views

Show PATH in a human-readable way

I want to show my PATH environment variable in a more human-readable way. $ echo $PATH ...
2
votes
3answers
989 views

Why do 'ssh host echo $PATH' and printing the $PATH after ssh'ing into the machine give different results?

On a particular host, when I ssh into the machine and enter echo $PATH I get /home/wxy/bin64:/home/wxy/bin:/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin and if I ...
-3
votes
1answer
4k views

“not a valid identifier” when I do “export $PATH”

When I run export $PATH in bash, I get the error not a valid identifier. Why? Here's my ~/.bashrc file # ~/.bashrc: executed by bash(1) for non-login shells. # see ...
2
votes
4answers
108 views

$PATH duplication issues

If I do echo $PATH I get the following: ...
0
votes
3answers
2k views

Get environment variable of other user [closed]

Is there a way I can see the environment variable of an other user? I want to do that as root, so permissions won't be a problem I guess. For the user himself, I use echo $PATH or set | grep PATH ...
3
votes
2answers
2k views

How does the path enviroment variable work in linux?

I'm confused how does the enviroment path work under linux, I'm a Linux Mint 15 user. First, I read about editing the /home/.bashrc file and doing a PATH=$PATH:/directory, but I also knew about ...
0
votes
0answers
31 views

Spurious “command not found” [duplicate]

I am in the process of trying to build and install pjsua on my embedded board running linux with a kernel which is a variant of 2.6.18.. The board is booted via nfs from my filesystem. I have built ...
1
vote
3answers
332 views

SUDO: Username condition in sudoers file

I'm trying to allow my user (via sudo, launched in a script) to copy a file from their home to a web directory. Command would be: sudo cp /home/$LOGNAME/file_source /var/www/$LOGNAME_file_dest So ...
4
votes
4answers
2k views

What is the `editor` command in bash?

I was looking for a command that would hopefully open the current user's favourite text editor, because I am writing out some instructions with commands in a blog. I was expecting a command like edit, ...
5
votes
2answers
2k views

Who sets $USER and $USERNAME environment variables?

Also, will these variables always match currently logged-in username (they do on my Debian system)? Can I assume their availability in other Unix(-like) systems? I'm also curious why one would use ...
2
votes
1answer
141 views

Any other way to define an environment variable?

I'm quite new to Linux. Debian Wheezy is now running on my Laptop (64 bits). I recently installed Oracle 11g R2 database for evaluation purpose, and defined environment variables (such as ORACLE_SID) ...
1
vote
1answer
248 views

Executing commands with PHP: using normal user, but its home directory is /root

I'm using a custom compiled installation of Apache + PHP, listening on port 80. Apache is configured to run as a normal user, with the proper settings User and Group of the httpd.conf file. After ...
3
votes
3answers
178 views

Where is the environment string actual stored?

But when we first time we adding a new name,we have to call malloc to obtain >room for a new list of pointers. We copy the old environment list to this new area and store a pointer to the ...
11
votes
4answers
3k views

Why do I have to re-set env vars in tmux when I re-attach?

I mainly work on a mac and ssh/tmux attach to a Linux machine to do my work. I have ssh-agent running on the Linux machine. I have set -g update-environment "SSH_AUTH_SOCK SSH_ASKPASS WINDOWID ...
1
vote
1answer
247 views

Openbox doesn't seem to have correct environment variables set

I've installed Debian 7.0, and then installed Openbox on top of it. I've got some executable files in ~/bin, and this line in my .bashrc and .profile: export PATH="$HOME/bin:$PATH" I can normally ...
3
votes
3answers
12k views

How to change locale environment variable?

I have generated en_US.utf8, et_EE.iso88591 and ru_RU.utf8 localisation files. Now if I try to change any of the locale variables to a ru_RU.utf8 or en_US.utf8, then this does not have any effect: # ...
0
votes
1answer
352 views

Difference between sudo su - user and sudo -iu user [duplicate]

I was wondering if there were any difference (in environment ?) between doing sudo su - user and sudo -iu user From what I know: By using sudo su - user I open a new shell as user, and the ...
5
votes
1answer
134 views

Permanent Environment Variable for all users

I want to have all users on the system to have an environment variable named SPI that points to /usr/local/share_ideas directory. How do I do it?
2
votes
1answer
37 views

Installing packages and tools on a local non-standard directory

TLDR: What environment variables should I update to guarantee that my system has access to everything a package provides when building it on a non-traditional path? I usually don't have root access ...
3
votes
1answer
225 views

Why is uname -M returning an empty string?

On the exact same machine (AIX 6.1), in 2 different login shells (both ksh), with different user IDs, I can do uname -M; in one shell I get the system model. In the other shell I get BLANK! The only ...
1
vote
1answer
74 views

Effect if any of changing LD_LIBRARY_PATH environnment variable on emacs fonts?

The rendering of my emacs fonts changes if I define a specific list of directories under the LD_LIBRARY_PATH environment variable just before I call emacs. I changed this because I wanted to use emacs ...
1
vote
2answers
162 views

How to print shell variables and values to be able to copy/paste them?

In Bash 4.2.25, the set and env output is not escaped, so shell escapes and any non-printable characters won't be copy-pasteable. Take for example this shell session: $ export foo=$'a\nbar=\baz' $ ...
1
vote
1answer
248 views

Why ssh -nq -t can't see my environment variable?

I am executing a command on remote machine with -t flag ( to prevent the command from 'blocking' ) the prompt (somehow it works that way). So I am using ssh -nq -t root@ip but with this, the script ...
-3
votes
1answer
169 views

Paths in my bash profile do not work!

export PATH=/usr/local/bin:/Users/rodrigoprugue/Desktop/CRUNCH:~/phreeqc/bin:$PATH export PARFLOW_DIR=~/parflow/parflow.r605/ export SILO_DIR=~/parflow/silo-4.7.2/ export ...
4
votes
4answers
626 views

Detecting X session in a bash script (.bashrc etc.)

Recently I put xset b off to my .bashrc. Now I'm annoyed by the error thet pops up when I log in via tty or via ssh, i.e. outside X session. First thing that came in my mind was [[ -z "$SOME_VAR" ]] ...
3
votes
5answers
2k views

Environment variable does not seem to work in sudo

I use apt behind a firewall, so I specify a proxy in the http_proxy environment variable. What I have done is added the following line to both .profile and .bashrc (for good measure) of the root ...
1
vote
4answers
266 views

Environment of another user in a child process

I have a parent process running as 'root' user. After fork(), execl() and setuid()/setgid(), the child process is started as another OS user (say user1). Printing the environment shows that this is ...
0
votes
1answer
86 views

Colon breaks the variable subsitution [closed]

I am trying to lookup some C functions so that I could debug while using strace. So I setup a bash function to look it up in firefox (or links), but the substitution falls apart with : and escaping ...
1
vote
2answers
461 views

Backup to a synology NAS with bup

I am trying to make a remote backup to my Synology NAS (DSM 4.1) using bup. I compiled bup on my NAS from source, did there: BUP_DIR=/volume1/public/Backups/bup bup init Initialized empty Git ...