Setting environment variables permanently.
Liam O'Toole
liam.p.otoole at gmail.com
Fri Mar 26 00:16:07 UTC 2010
On 2010-03-25, Tom H <tomh0665 at gmail.com> wrote:
---SNIP---
>>>>> Use
>>>>> export some_var=some_value
>>>>> in your ~/.bashrc
>
>>>> You could also put the line in ~/.profile. This is useful if you want
>>>> the variable to be available outside of bash as well, e.g., in a
>>>> graphical application launched from the menu.
>
>>> Except that ~/.profile is not executed for a non-login shell.
>
>> Indeed. However, any non-login shell (or other application) will inherit
>> the exported variable from the login shell. Try it.
>
> Theoretically, maybe; but
>
> - clean install of 10.04
>
> - added
> alias dig='dig @8.8.8.8'
> to
> ~/.profile
>
> - rebooted
>
> - launched gnome-terminal
>
> - ran dig and it queried my dhcp-provided dns server
>
You are confusing environment variables and aliases. The former can be
inherited by a child process from its parent; the latter is meaningful
only within a particular shell instance. When you launch gnome-terminal
as described above and type 'alias' to list currently defined aliases,
what do you see?
--
Liam O'Toole
Birmingham, United Kingdom
More information about the ubuntu-users
mailing list