Environment variables

Nils Kassube kassube at gmx.net
Wed May 28 07:16:50 UTC 2008


Robert Holtzman wrote:
> I'm not sure I see the logic in having the PATH and LANG variables in
> /etc/environment and the HISTCONTROL, PS1, PROMPT_COMMAND, among
> others, in ~./.bashrc.

Actually it is in "~/.bashrc" where "~/" is expanded by the shell 
as "$HOME/" while ~./.bashrc would not be expanded. Yes, I know that's 
pedantic, but so are computers :)

The variables PATH and LANG are known by all shells while HISTCONTROL, PS1 
and PROMPT_COMMAND are specific to bash. Therefore you could put the last 
ones in /etc/environment but they would be ignored for any shell except 
bash. And to be pedantic again, there may be other shells which know 
these variables as well. Anyway, it only makes sense to use those 
variables known to the shell in use.


Nils




More information about the ubuntu-users mailing list