Re: PATH puzzle
Icarus Sparry wrote:
> On Mon, 31 Dec 2007 06:32:01 +0000, John W. Krahn wrote:
>
>> I was recently doing something and noticed that /home/john/bin was
>> included in my PATH twice. I did a recursive search through /etc and
>> /home/john and the only place I could find where /home/john/bin was
>> added to the PATH was in /home/john/.profile. If I comment out the
>> modification in /home/john/.profile then I still get /home/john/bin in
>> PATH. Note that this only effects users and not root. OS is Kubuntu
>> 7.10 and shell is GNU bash, version
>> 3.2.25(1)-release-(i486-pc-linux-gnu).
>
> Hard to tell from this information!
>
> Is this a console login, or are you running X windows?
No problems on a console login, just, it seems, on xterm.
> If you use "ssh localhost" do you still have the same issue?
> Does your home/john/.profile append /home/john/bin to your PATH or does
> it set the PATH to a fixed value?
This is what is in /home/john/.profile which, it appears, was copied
from /etc/skel/.profile when the account was created.
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
> Have you looked for $HOME/bin and ~/bin as well as /home/john/bin?
I did a search for 'PATH'.
> Have you tried adding some lines like
> set -x
> echo "At start of .profile" $PATH
> to the start of the .profile, and
> echo "At end of .profile" $PATH
> set +x
> to the end? If so is /home/john/bin in the PATH at the start of .profile?
> How many times do you see the .profile being executed?
I tried that and there are too many lines generated to see what is
happening at the beginning.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
|