LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-15-2005, 11:47 AM   #1
geomonap
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Rep: Reputation: 0
/etc/profile


Hello all:
I would like a particular user to not to source its path from the /etc/profile file. I added a PATH variable in the user's .bash_profile file but when I echo $PATH as the user, the account still sources the PATH from the /etc/profile file. I added the following lines to the .bash_profile file of the account

PATH=/usr/xxx/xxx
export PATH


How can I force the account to source its path only from what is specified in the .bash_profile file ?

Regards

Gm
 
Old 08-15-2005, 12:06 PM   #2
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Please post the entire ~/.bash_profile
 
Old 08-15-2005, 12:08 PM   #3
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

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

export PATH
unset USERNAME
 
Old 08-15-2005, 12:09 PM   #4
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
oh no sorry wrong post ignore my bash_profile
 
Old 08-15-2005, 12:09 PM   #5
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
what if you add PATH="" _before_ the PATH=$PATH:$HOME/bin:/usr/bin/:/usr/local:/usr/local/bin:/usr/sbin:/sbin:.
in .bash_profile ?
 
Old 08-15-2005, 12:13 PM   #6
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
how would the whole thing look?
 
Old 08-15-2005, 12:39 PM   #7
geomonap
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by TruckStuff
Please post the entire ~/.bash_profile
Here is how my .bash_profile file looks ( the path is just an example )
# more .bash_profile
PATH=/usr/bin
export PATH


In Solaris, this would work but it doesn't seem to work in linux. Any ideas on what I need to do so that the user just has the path mapped which is specified in the .bash_profile file. Right now, it completely igores the path specified in the .bash_profile file and gets it from the /etc/profile file.

regards,
Gm
 
Old 08-15-2005, 01:06 PM   #8
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
bash use the first found of the following : ~/.bash_login , ~/.profile , ~/.bash_profile.

If you have .bash_login or .profile, ~/.bash_profile will be completly ignored (unless you use something like "source ~/.bash_profile" or a trick like this in the .profile or .bash_login).
Make sure you don't have those files if you want to use .bash_profile.
 
Old 08-15-2005, 01:44 PM   #9
geomonap
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Half_Elf
Make sure you don't have those files if you want to use .bash_profile.
the only files I have in the user's home directory are
.bash_profile
.bash_history
.bash_logout
.ssh

Any ideas?

-GM
 
Old 08-15-2005, 01:51 PM   #10
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
if you put something like echo "TEST TEST TEST TEST" in your .bash_profile, it is not executed, is it?

What's your bash version and distribution?
 
Old 08-15-2005, 03:48 PM   #11
geomonap
LQ Newbie
 
Registered: Dec 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Half_Elf
if you put something like echo "TEST TEST TEST TEST" in your .bash_profile, it is not executed, is it?
No it is not executed

Quote:
What's your bash version and distribution?
GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
 
  


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
non roaming profile on a roaming profile system fieldyweb Linux - Newbie 1 10-03-2005 12:27 PM
Help with Profile` issinho Linux - Distributions 2 07-26-2005 03:40 PM
where is my .profile ? rob99 Linux - Newbie 2 04-07-2003 10:01 PM
profile help jalburger Linux - Newbie 3 07-10-2002 10:54 AM
/etc/profile flex411 Linux - General 7 05-11-2001 12:50 PM

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

All times are GMT -5. The time now is 04:31 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
Open Source Consulting | Domain Registration