Whenever I start a shell my $PATH starts with /usr/bin. Does anybody know where this might come from?
I customize my $PATH in ~/.profile but not in ~/.bashrc by
export PATH=<some other path>:$PATH
Regards,
Michael
(I’m running openSUSE 11.0 (x86_64) with KDE 3.5.9 “release 49.1”)
@syampillai: can’t find any additional PATH settings in my konsole configuration.
@thisoldman: $PATH is only changed in /etc/bash.bashrc in these lines:
>if test -n “$restricted” -a -z “$PROFILEREAD” ; then
> PATH=/usr/lib/restricted/bin
> export PATH
>fi
nowhere else.
I’m not confident with my skills with ‘find’ and ‘grep’ but the following code should show which files to examine, I think.
find . -exec grep -ls "PATH=" '{}' \;
The command should examine all files in a directory and its subdirectories and print the filenames that contain the string matching “PATH=”. You could use “PATH=/usr/bin” as the search string, but that would not find, for example, “PATH=$MY_PATHX:$PATH” where $MY_PATHX expands to “/usr/bin”.
There is probably a more efficient way to find this for you. I hope someone will pass it on to us.
so true, but it looks like as if that particular change happens after ~/.profile is run and before /etc/.bashrc is run again when I open a shell. At the end of ~/.profile my PATH is still alright.
Does anybody know which files are executed between those two?