How to set an Enviroment variable?
Francisco Borges
francisco.borges at gmail.com
Fri Mar 21 09:56:37 UTC 2008
On Thu, Mar 20, 2008 at 2:13 PM, Derek Broughton <news at pointerstop.ca> wrote:
>
> Francisco Borges wrote:
> > From the bash manual:
> > =========
> > When bash is invoked as an interactive login shell, or as a
> > non-interactive shell with
> > the --login option, it first reads and executes commands from the
> > file /etc/profile,
> > if that file exists. After reading that file, it looks for
> > ~/.bash_profile,
> > ~/.bash_login, and ~/.profile, in that order,
> > =========
> >
> > So as far as I can tell, bash will only read ~/.bashrc when you start
> > it "interactive non-login",
>
> Possibly. I always find the different bash scripts confusing, but I _think_
> that's wrong. aiui, .bashrc is executed for _every_ shell - interactive or
> not, login or not, whereas .profile only executes for login shells (it
> doesn't _need_ to be set for non-login shells, as they inherit from a shell
> that already has the .profile settings). But I could be wrong...
I am an avid shell user but actually not a bash user ;-) so it took me
a while to remember this.
Debian has for a long time set the default ~/.profile to source
~/.bashrc (if the user is running bash). So in practice, if you don't
change that, any time you run bash on a Debian system you will also
source ~/.bashrc.
The default ~/.profile for new accounts is at /etc/skel/.profile (in
the case you have, like me, deleted yours).
Kind regards,
--
Francisco
More information about the kubuntu-users
mailing list