LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-29-2001, 12:32 PM   #1
drobson
LQ Newbie
 
Registered: May 2001
Distribution: RedHat 7.1
Posts: 17

Rep: Reputation: 0
Question 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
 
Old 07-01-2001, 07:39 PM   #2
CragStar
Senior Member
 
Registered: Oct 2000
Location: UK - Frome
Distribution: Ubuntu
Posts: 1,081

Rep: Reputation: 47
Have you checked in /home/<username>/.bashrc?

That is were I edit my PATH.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set my so path? hongxing Linux - Software 1 10-20-2005 03:23 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 03:52 AM
$PATH!? how to set these PATH(s)!? sirpelidor Red Hat 5 10-25-2003 05:00 PM
Set Path reaky Linux - Newbie 2 10-09-2003 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration