LinuxQuestions.org
Review your favorite Linux distribution.
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 09-29-2004, 02:39 PM   #1
camroe
LQ Newbie
 
Registered: Sep 2004
Location: Calgary
Posts: 1

Rep: Reputation: 0
Question Pathbeing set from unknown location


So - this is not a show stopper but it is really bugging me.

My (non-root user) path is currently set to

/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/ant/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/JMatos1.1:/home/camroe/bin

There are 2 things wrong with this PATH.

1. /usr/local/bin appears twice
2. I can't figure out where /usr/local/JMatos1.1 is being set from!

I have carefully followed the places where I think that PATH is being set. Here is what I understand to be the case.

0. For a non-root user the PATH defaults to be /usr/local/bin:/usr/bin:/bin
1. /etc/profile
1a. /etc/profile executes all the '.sh' files in /etc/profile.d
1b. /etc/profile executes inputrc
2. /$HOME/.bash_profile
2a. .bash_profile executes .bashrc
2aa. .bashrc executes /etc/bashrc

In following this path I can see nowhere where /usr/local/bin or /usr/local/JMatos1.1 is being set. I assume that the initial /usr/local/bin:/usr/bin:/bin settings in the PATH are there by default. (where would this be set ?)

I have grep'ed /etc/profile.d/*.sh for /usr/local/bin and 'JM' and found nothing. I have checked every file in the above list for the setting of /usr/local/bin or JMatos and can't find them.

Is there anywhere else I can look? Again this is not a show stopper but it's bothering me that things are being set and I can't find out where. I've included below

1. /etc/profile
2. .bash_profile
3. .bashrc

If someone could point me in the right direction it would be great!

Thanks

Cam

-------------------------------------------------------
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|$1($|" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# Path manipulation for root or u=0
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#Move the setting of the Java path to each individual
# pathmunge /usr/java/jdk1.3.1_03/bin/
fi

pathmunge /usr/X11R6/bin after


# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
CATALINA_HOME=/usr/local/tomcat
MYSQL_HOME=/usr/local/mysql
#JAVA_HOME=/usr/java/jdk1.3.1_03
JAVA_HOME=/usr/java/j2sdk1.4.2_05
ANT_HOME=/usr/local/ant
pathmunge ${ANT_HOME}/bin
pathmunge ${MYSQL_HOME}/bin
#export PATH=${PATH}:/usr/local/bin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC ANT_HOME JAVA_HOME CATALINA_HOME MYSQL_HOME
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
unset pathmunge
-----------------------------------------------------------
# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

--------------------------------------------------

# .bashrc

# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
 
Old 09-29-2004, 04:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,999
Blog Entries: 11

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Have a look at the scripts in the /etc/profile.d
directory too ...


Cheers,
Tink

Last edited by Tinkster; 09-08-2005 at 03:20 AM.
 
  


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
Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) senthilpr_in Linux - Newbie 4 02-26-2007 01:46 PM
GD location tbl_123 Linux - Newbie 2 11-15-2005 07:00 PM
apache: location in location eantoranz Linux - Networking 2 08-08-2005 10:37 PM
atkbd.c: Unknown key released (translated set 2, code 0x7a on isa0060/serio0). atkbd. satanic_linux Slackware 1 06-08-2004 03:11 PM
How to view set-user-ID and set-group-ID Xris718 Linux - General 7 01-10-2004 02:44 PM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration