LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Where does $PATH initially&subsequently get set? (https://www.linuxquestions.org/questions/linux-general-1/where-does-%24path-initially-and-subsequently-get-set-3819/)

drobson 06-29-2001 11:32 AM

Where does $PATH initially&subsequently get set?
 
I can't find where in the manuals that tells how $PATH is initially
set from a boot-up and then also what other scripts from then on
which might also be modifying $PATH.

The problem I'm trying to clear up is that my $PATH has got
several duplicate entries and I want to clean it up. But, I don't
know 'who' all is setting it up and 'who' all is making modifications
along the way.

I have looked in /etc/profile which contains the following:

if ! echo $PATH | /bin/grep -q "/usr/X11R6/bin" ; then
$PATH="$PATH:/usr/X11R6/bin"
fi

My question is, if /etc/profile is the first script to execute which
sets $PATH, then WHY is it testing it for the presence of a path
name if it isn't expecting $PATH to ALREADY have been set to
some value????? If there were to be something there,
(viz. "/usr/X11R6/bin") then /etc/profile could not have been the
first script to set $PATH.

The following is in my /root/.bash_profile (I am having this
symptom while logged in as root):

PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH:$HOME/bin

From boot-up, which script is the first to set up the default $PATH?
From log-in, what other scripts may or will be run to modify the
default?

I'm using RedHat 7.1

Thanks
Doug

CragStar 07-01-2001 06:39 PM

Have you checked in /home/<username>/.bashrc?

That is were I edit my PATH.


All times are GMT -5. The time now is 04:25 AM.