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

learn more… | top users | synonyms

1
vote
2answers
170 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
260 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
175 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
680 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
300 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
87 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
492 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 ...
3
votes
1answer
237 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? ...
7
votes
4answers
4k 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
2answers
509 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
1answer
220 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 ...
1
vote
1answer
458 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 ...
2
votes
1answer
2k 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 ...
0
votes
2answers
1k 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 ...
6
votes
1answer
1k 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
3k 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 ...
-1
votes
3answers
1k views

How to run a shell script with export command in crontab

I have a shell script that exports values of variables when executed. The same values will be used in another script. How to run this script(test.sh) in cron. #!/bin/sh export I="10" echo $I I will ...
1
vote
2answers
722 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 ...
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 ...
0
votes
3answers
1k 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
278 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
251 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
234 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 ...
2
votes
3answers
136 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 ...
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 ...
0
votes
1answer
384 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 ...
2
votes
2answers
1k 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) ...
3
votes
2answers
842 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
664 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 ...
3
votes
1answer
481 views

Why can I only use apt-get when I use “su”?

Not sure what info you need here, if any. Just let me know. I have a proxy that bypasses the corporate net set in my profile file for both su and normal user. When I do a sudo or regular apt-get ...
2
votes
2answers
99 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
668 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 ...
7
votes
3answers
16k 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
107 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.
10
votes
2answers
1k views

How can I create a clean shell environment for temporary use?

I am a frequent answerer on a Unix-focused popular Q&A site, and in many of my answers I provide examples using the bash shell. However, each time I do this I have to manually go through the ...
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
267 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
911 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 ...
0
votes
2answers
990 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 ...
4
votes
2answers
913 views

How to add a path to system $PATH for all users's non-login shell and login shell on debian

I installed some programs in /opt/my-program/bin, I wanted to add /opt/my-program/bin to system $PATH for all users's non-login shell and login shell. What should I do? Changing /etc/environment is ...
4
votes
2answers
319 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 ...
17
votes
3answers
4k views

How to run a program in a clean environment in bash?

I want to run a program in an empty environment (i.e. with no envariables set). How to do this in bash?
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
400 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
3answers
5k views

How to add a path to system $PATH for all users's non-login shell for debian

After installing some programs in /opt/xxx/bin, I want to add /opt/xxx/bin to system $PATH for all users's non-login shell. What should I do?
2
votes
1answer
1k views

export PATH only once per login in zsh

I need to alter my PATH variable so I put export PATH=$PATH:somedir in my $HOME/.profile which is sourced by my $HOME/.zshrc. This works, yet whenever I open a new terminal (urxvt in X11), .zshrc ...