The environment-variables tag has no wiki summary.
6
votes
3answers
117 views
+100
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 ...
3
votes
3answers
91 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 ...
1
vote
1answer
19 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 ...
1
vote
2answers
108 views
How do I set an environment variable for sudo in MacOS?
I have installed ServiceMix on my machine, and am trying to start it. The startup script is called start.sh. When I did ./start.sh, it gave me a Permission Denied message. So I used sudo ./start.sh, ...
1
vote
4answers
248 views
linux shell global linux memory in mem variable - from shell
Is there any way for me to set an env variable without editing files to be in memory and effect other shells as well, which will take effect on any new user who connects that machine and will take ...
15
votes
5answers
422 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 ...
0
votes
2answers
522 views
$PATH in /etc/profile not inherited by user shell
I have this in /etc/profile in Fedora 17:
PATH=$PATH:"/usr/pgsql-9.2/bin"
EDITOR="/usr/bin/emacs -nw"
PSQL_EDITOR="/usr/bin/emacs"
PAGER="/usr/bin/less"
export PATH USER LOGNAME MAIL HOSTNAME ...
1
vote
1answer
62 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 ...
0
votes
0answers
16 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 ...
1
vote
2answers
40 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
33 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 ...
1
vote
2answers
390 views
Setting locale for user
I'd like to set a locale for my user different than system locale.
By putting export LANG=en_US.utf8 in .bashrc I could do that for the shells, but still it's not working for applications not started ...
4
votes
1answer
45 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?
7
votes
3answers
10k views
How can I run a cron command with existing environmental variables?
How can I run a cron command with existing environmental variables?
If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
5
votes
4answers
2k views
Adding paths to PATH using a multi-line syntax
As far as I understand, the usual way to add a path to the PATH environment variable is by concatenating paths separated by the : character.
For example, if I want to add three paths to it ...
2
votes
1answer
24 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
69 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 ...
9
votes
1answer
225 views
How do you set up the environment for es?
I've been playing with es the last couple of days, and it (like rc) has the quirk/feature that it only runs its startup script (.esrc) on login. The usual way to run code in each interactive session ...
1
vote
1answer
37 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
68 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'
$ ...
-2
votes
1answer
50 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
125 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" ]] ...
2
votes
2answers
808 views
How can I expose JAVA_HOME to applications running under X and/or Gnome?
I'm trying to run IntelliJ from Gnome3's Applications menu, but it complains the JAVA_HOME variable is not set.
I have the Java installation under my home folder.
I managed to export the variable in ...
2
votes
5answers
112 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
41 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
38 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 ...
5
votes
3answers
2k views
How to read environment variables of a process
Linux's /proc/<pid>/environ does not update (as I understand it, the file contain the initial environment of the process).
How can I read a process's current environment?
1
vote
2answers
138 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 ...
2
votes
1answer
59 views
How to print apparently hidden environment variables?
Environment variables can be shown with env; but, some are not shown. For example...
echo $EUID might produce as result of 1000 yet
env | grep EUID produces no result.
What is this type of variable? ...
11
votes
4answers
28k views
How do I set a user environment variable? (permanently, not session)
This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked.
How do I set an environment variable for a specific user? I am on debian squeeze.
...
5
votes
2answers
311 views
Prevent SSH client passing TERM environment variable to server?
I'm currently using Fedora 18 gnome-terminal, then started tmux multiplexer in it. After I connected to a CentOS 5 server via ssh command, I find:
ls result has no color
tmux, screen, hexedit, htop ...
1
vote
1answer
89 views
Set environment variable for all of tmux shells when gnome-sessions gets restarted
To solve this problem, I need to set the environment variable DBUS_SESSION_BUS_ADDRESS for all shells inside tmux every time I restart gnome without restarting tmux (this is often). How can I best ...
1
vote
1answer
73 views
Variable expansion did not happen in /etc/environment
I changed the /etc/environment to add more directories to the PATH variable. But looks like $PATH in double quotes were not expanded and I could find any command from the shell and ...
0
votes
2answers
104 views
Is there anyway to set a readonly environment variable?
I am using the following in openssh/telnet code, which sets the user environment.
setenv("TEST_ENV", "testing", 1);
But this can be modified by the user, is there anyway to make it readonly env ...
2
votes
1answer
202 views
Users home path in a bash script
I'm writing a bash-script that will be run as a cron job everyday. Very basic, I was wanting to change the wallpaper daily. I have mint-14 with mate.
The thing I'm getting caught up on right now ...
5
votes
1answer
87 views
grep: Ignoring GREP_OPTIONS to search case-sensitive
I have set GREP_OPTIONS="--ignore-case --color" in ~/.bashrc as I normally want grep to work case-insensitive. However, there are times when I need grep to actually search case-sensitive, but the man ...
1
vote
1answer
251 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 ...
3
votes
1answer
196 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
249 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
108 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
1k 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
209 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
145 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
17
votes
4answers
5k views
Why is `while IFS= read` used so often, instead of `IFS=; while read..`?
It seems that normal practice would put the setting of IFS outside the while loop in order to not repeat setting it for each iteration... Is this just a habitual "monkey see, monkey do" style, as it ...
3
votes
1answer
110 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
111 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 ...
23
votes
2answers
1k 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
98 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 ...
11
votes
1answer
2k 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
693 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 ...




