what is an environment variable?

Smoot Carl-Mitchell smoot at tic.com
Sat Mar 17 00:15:57 UTC 2012


On Fri, 2012-03-16 at 23:03 +0000, Thufir Hawat wrote:
> I've looked at https://help.ubuntu.com/community/EnvironmentVariables and 
> some other resources, but it's still unclear to me *what* $PATH is.  
> There's no corresponding file, just various files which add to the this 
> variable.  (It's a shell variable?)

PATH is an exported shell variable.  So it shows up as part of the
environment in a forked process.

> How do you see all the files which effect $PATH?  You just have to go 
> through ~/.bash* and ~/.profile* and such, as well as /etc/evironment?

Ubuntu lets you add stuff to the startup shell by adding shell fragments
in /etc/profile.d.  I'll bet there is a ruby configuration script there.
Read the bash man page for how bash uses its startup files. It is useful
to read the /etc/profile for some Ubuntu specific alterations.
Reading files in /etc/profile.d is one of them.

> Once something is added to $PATH, how do you remove it?

You'd need to write an inline script.  You can see some examples by
searching the Internet.

-- 
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
smoot at tic.com





More information about the ubuntu-users mailing list