bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATH value doesn't get updated


From: Carl Wenrich
Subject: Re: PATH value doesn't get updated
Date: Mon, 12 May 2008 16:46:47 -0700 (PDT)

echo $0 gives me "bash"
echo $- gives me "himBH"

Bob Proulx <address@hidden> wrote: Carl Wenrich wrote:
> Bob Proulx wrote:
> > Did you log in after having made that change?  Was bash invoked as
> > an interactive login shell so that it would read that file?
> > 
> >   echo $0
> >   echo $-
>
> Yes. I (1) made the change to .bash_profile, then (2) restarted the
> machine, then (3) logged in again. When I echo $PATH the
> /opt/lampp/bin is not included.

That second question was also very important.  Without that
information I don't know if I should suggest one action or a different
action.

  Was bash invoked as an interactive login shell so that it would read
  that file?

The way I tell is by running those two commands that I suggested
running.  What do you get for the following two commands?

  echo $0
  echo $-

The $0 is the name used to invoke the shell.  If it starts with a '-'
then this is used to instruct the shell that it is a login shell.  The
second variable $- is the flags set to the shell.  The 'i' for
interactive should be in there.

Example: NOT a login shell, will NOT source .bash_profile:

  $ echo $0
  bash
  $ echo $-
  himBHP
  $

Example: Yes, a login shell:

  $ echo $0
  -bash
  $ echo $-
  himBHP
  $

And of course the bash "-l" and "--login" options will override this
default behavior.

If it is not a login shell then to suggest improvements it would be
necessary to know the type of system you are using and how you are
logging into it.  There are many possibilities and I can't guess which
one you might be using.  You didn't say in your messages.

By the way... It is not necessary to restart your system.  That is way
too much.  Simply log in again to have profile file changes take
effect.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]