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

learn more… | top users | synonyms

1
vote
2answers
134 views

cd ${DIR_PATH} returns 'No such file or directory'

OS = MacOS 10.8.5/Darwin Kernel Version 12.5.0. In my .bash_profile I have: export DIR_PATH=~/concrete/path At the terminal >echo ${DIR_PATH} ~/concrete/path Also explicit cd works: ...
3
votes
2answers
119 views

How can I make shell aliases available when shelling out from Vim?

In my .zshrc, I declare some aliases. Eg, which dbstart shows the contents of that alias. If I open vim from that shell, it is a child process. In Vim, I can run shell commands with :! some_command. ...
1
vote
1answer
61 views

$@ and 'set env $PATH' - Why should this statement go into .inputrc?

I have a line in my .zshrc that says: set env $PATH Apparently this affects the value of $@. I have read that $@ should be empty and that I should not have any set statements in my .zshrc (at least ...
5
votes
2answers
422 views

Local variables in zsh: what is the equivalent of bash's “export -n” in zsh

I'm trying to contain the scope of a variable to a shell, and not have children see it, in zsh. For example, I type this in .zshrc: GREP_OPTIONS=--color=always But if I run a shell script with the ...
1
vote
2answers
59 views

Environment variable for command called via nice

I need to set an environment variable for a command that is being called via nice. [Bash and dash, Slackware and FreeBSD.] $ JIM=20 nice -n 10 echo $JIM $ Nope, echo can't see JIM $ nice -n ...
3
votes
1answer
35 views

How to read value of variable, where the name of variable is the value of another variable

I think an example is in order. Consider I have these two environment variables setup (by a Continuous Delivery tool): PACKAGE_VER=1.2.3 and USE_VERSION_FROM=PACKAGE_VER. What I want now is a script ...
2
votes
1answer
101 views

How to set environment variables under MATE?

I have just installed MATE under Ubuntu Saucy. No problems. Except I am trying to setup Texmaker, the LaTeX IDE, and cannot figure out how to set the paths to the LaTeX tools (pdflatex, etc.) which ...
1
vote
3answers
225 views

HowTo Chroot to BSD

I recently tried FreeBSD [9.2]. I installed it but as i found out it doesn't install any bootloader by default. So now i want to find out HOW it is possible to chroot to the installed BSD via a ...
3
votes
3answers
483 views

How do I create a GUI application launcher for xfce4-terminal with fish but inheriting the environment variables from bash?

If I run fish from a bash prompt, it will inherit the environment variables I have set in my .bashrc and .profile files, including the important $PATH variable. So far so good. Now, I want ...
4
votes
2answers
118 views

Expansion of a shell variable and effect of glob and split on it

This post actually contains two separate questions but I think grouping them together will give some more context. I have gone through this question on quotes around variables but I do not quite ...
2
votes
2answers
356 views

Removing a directory from PATH

I'm trying to compile wxWidgets using MingW, and I have cygwin in my path, which seems to conflict. So I would like to remove /d/Programme/cygwin/bin from the PATH variable and I wonder if there is ...
0
votes
3answers
219 views

I have an environment variable for LANG set in ~/.profile but it is not getting set

I want to set the locale. I have this in my ~/.profile #language export LANG=en_GB.utf8 export TESTING123=en_GB.utf8 But when I type: echo $LANG $TESTING123 I get (LANG not set, but TESTING123 ...
8
votes
2answers
407 views

using export in .bashrc

I have noticed in my .bashrc, that some lines have export in front, such as export HISTTIMEFORMAT="%b-%d %H:%M " ... export MYSQL_HISTFILE="/root/.mysql_history" whereas other have not, such as ...
2
votes
1answer
116 views

local shutdown scripts (do's and don't's)

At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to vagrant halt any virtual boxes I may have ...
2
votes
2answers
205 views

From where does printenv command read environment variables which I have not defined?

The printenv command lists a number of environment variables most of which I have not defined. From where does it read these values? Where are the environment variables stored in Linux? strace ...
1
vote
2answers
262 views

How to loop through xargs where each script uses a common env variable

Is it possible to initiate 10 of the same shell scripts which also initiate more copies, and have them all use the same env variable? For example: script.sh: #!/bin/bash export ...
0
votes
1answer
76 views

ENV variables in relation to xargs loops

Are env variables (set using export) treated differently when the same script is run multiple times simultaneously? That's a weird question, so here's an example I built out which is similar to my ...
0
votes
0answers
72 views

Application does not see environmental variables

I am running following 32 bit command on 64 bit system: LIBGL_DEBUG=verbose glxinfo32 -v -t | head -5 It's output says direct rendering: No (If you want to find out why, try setting ...
1
vote
2answers
47 views

Running a program to output in Dutch

I'm running KDE Arch linux and trying to update my system using pacman and have it output in Dutch. I've tried the following sudo LANG=nl_NL.UTF-8 pacman -Syy sudo KDE_LANG=nl_NL.UTF-8 pacman -Syy ...
-3
votes
1answer
78 views

where is this HOME environment variable and what do I have to add -H too it?

I recently attempted to run a boot up script which failed I didn't know why it failed so I posted a question about that here. chkconfig bootup script failing, script runs good manually Where the ...
2
votes
1answer
52 views

How to avoid warnings from subshells if the function in PROMPT_COMMAND is not defined?

I'm using the following code to get a nice prompt (including git information etc.): function set_prompt { # magic happens in here ;) } export PROMPT_COMMAND='set_prompt' However, sometimes I ...
1
vote
2answers
92 views

modify user-defined System Variables(that is a number) of remote Server machine using ssh?

I want to modify the value of a System Variable of a remote server . The IP of server is 172.16.22.53. The server runs Windows OS,and Cygwin instlled in it.In ...
2
votes
1answer
98 views

Setting the TOPCOLORS environment variable

I don't seem to be able to find any examples on the Internet for this environment variable, which top will apparently read and use to display colours. How would I set this variable correctly so top ...
2
votes
1answer
142 views

bash set env variable is not working in pdsh

I am using PDSH to control multiple servers through one command line. The command below works fine on individual servers, but when I enter the export command within PDSH, echoing it back is empty. ...
5
votes
4answers
150 views

How do I use which(1) with the system's default $PATH?

I would like to use which with the system's default path, ignoring any embellishments from the user's shell configuration files. Motivation I am attempting to write a script to find the system's ...
1
vote
1answer
73 views

exported variable disappears when I open a new terminal

I type this: export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk so that I can access that directory by typing cd $JAVA_HOME but every time I close and open the terminal I have to do this again and ...
1
vote
1answer
77 views

How to retrieve environment variable from string name in KSH

I've the following variable : x="envVar" and 'envVar' is the one of my environment variable's name containing a path (of a folder by instance). So I'd like to do cd $x but it doesn't work. ...
1
vote
3answers
1k views

Set environment variable automatically upon SSH login (no root access)

The situation: I run Ubuntu 12.04 LTS on a virtual machine. I regularly have to connect to my account on a university server, I do this by opening up terminal and using ssh -Y username@server.com. ...
4
votes
2answers
1k views

rkhunter warn me about root.rules

I run : :~$ sudo rkhunter --checkall --report-warnings-only One of the warnings I've got : Warning: Suspicious file types found in /dev: /dev/.udev/rules.d/root.rules: ASCII text and ...
0
votes
1answer
105 views

How to undo DISPLAY export in linux?

I have exported my X display to another computer using this command: export DISPLAY=xxx.xxx.xxx.xxx:0.0 How can I undo it?
1
vote
4answers
152 views

How do I run a program in a fresh shell?

I have a program that does a LOT of env manipulation. It sets PYTHONPATH and LD_LIBRARY_PATH and stuff like that. This program needs to run ANOTHER program, but in a fresh env, without all of the ...
0
votes
1answer
29 views

How do I display contents of a file where PATH environment changes are made?

Say I change the $PATH environment variable. If I'm asked to display the contents of the file where this change happened, how would I do this?
0
votes
4answers
74 views

Unset http_proxy enviroment variable

Updated 11/03: After doing some test with your suggestions, I only can be sure about one thing: there is something related to the graphical environment, because if I login through ssh or using ...
3
votes
3answers
307 views

Adding prefixes/suffixes to file names without typing it all over again?

I would like to do something like the following $ tmp=name* $ mv $tmp new_$tmp $ ls new_* $ new_name-with-stuff-i-dont-want-to-type name-with-stuff-i-dont-want-to-type Setting the environment ...
2
votes
1answer
241 views

Restrictions of /etc/profile in Gnome

I have an issue which bugs me for a long time. I'm using the Intel C++ compiler which includes shell scripts to set up environment variables for library paths, include paths and more. Sourcing these ...
4
votes
1answer
281 views

Escape hash mark (#) in /etc/environment

I am adding an env variable to /etc/environment but because the variable value contains # sign, string is striped. MYSQL_PWD="something#no" Now if I do env above code yields MYSQL_PWD=something. ...
3
votes
3answers
395 views

Setting hostname variable right after SSH login

I have set of some (third-party) shell scripts, which are supposed to connect to remote host and start some daemons (hadoop, if that matters). These scripts rely heavily on hostname in order to ...
0
votes
0answers
527 views

Removing path in env variable PATH permanently [duplicate]

I have recently installed Code Sourcery's ARM EABI Tool Chain. All the executable binaries were installed in a separate folder. I thought that the bin path will be added to env variable $PATH. ...
2
votes
1answer
47 views

Checking the order of items in a shell environment variable

I am wanting to check that a certain directories always appear after other directories in an environment variable. List items are separated by a colon, as with the PATH variable. This is not simply ...
3
votes
1answer
63 views

Appending values to environment variables from within Emacs

I am new to Elisp. I would like to do the following in my init file: ; Retrieve the value of LD_LIBRARY_PATH ; Append '/path/to/some/lib/:'to it ; Save the new value of LD_LIBRARY_PATH So far I ...
1
vote
1answer
41 views

Launching an application with an user environment

If I launch eclipse from the command line, the application is aware of the environment variables of the user (e.g. PYTHONPATH) and sets up the interpreter accordingly with Auto Config. This is not the ...
1
vote
1answer
1k views

How to assign result of sed to variable

Below is a complete copy of a demo I'm using to to figure out to get the sed command to get rid of the spaces in a persons name, and compress it down to not have spaces. Once this is done, I want to ...
2
votes
2answers
1k views

Exporting a variable with dot (.) in it

How to export a variable which has dot in it. I get 'invalid variable name' when I tried : export my.home=/tmp/someDir -ksh: my.home=/tmp/someDir: invalid variable name Even escaping metacharacter ...
2
votes
3answers
68 views

Is it a good idea to put environment variables to /usr/local/bin

I'm using aws cfn to start ubuntu instances, and I need to pass variables provided in cfn launch script to the scripts on the instance. For example, I may pass "db-server=db-2.domain.com" and there is ...
4
votes
2answers
81 views

how to prevent exported environment variables to be recognized/accessible by a child shell (bash)?

So, I need to prevent loads of exported variables to be recognized by a child shell. The problem is an application (Wine+UDK) wont build projects with too many (>65535) bytes on the environment, ...
2
votes
2answers
841 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
183 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
1k 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?