LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2003, 11:04 PM   #1
donald_lam
LQ Newbie
 
Registered: Aug 2003
Distribution: Mandrake 9.1
Posts: 2

Rep: Reputation: 0
Question problem with PATH....wtf??


Hi--

I upgraded Qt to 3.2.0, and as part of the install the instructions were to add the following lines to ~/.profile (for bash)...

QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/doc/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH

Well, since I don't have a /.profile in my home dir, I added these lines to /etc/profile (I want it available to all users).

/etc/profile now looks like this:

/etc/profile -*- Mode: shell-script -*-
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>

loginsh=1

# Users generally won't see annoyng core files
[ "$UID" = "0" ] && ulimit -S -c 1000000 > /dev/null 2>&1

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

if [ "$UID" -ge 500 ] && ! echo ${PATH} |grep -q /usr/games ; then
export PATH=$PATH:/usr/games
fi

umask 022

USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HISTCONTROL=ignoredups
HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/doc/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH


# some old programs still use it (eg: "man"), and it is also
# required for level1 compliance for LI18NUX2000
NLSPATH=/usr/share/locale/%l/%N

export PATH PS1 USER LOGNAME MAIL HOSTNAME INPUTRC NLSPATH
export HISTCONTROL HISTSIZE

for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done

unset i


~/.bashrc looks like this:

.bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


and ~/.bash-profile like this:

.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


/root/.bashrc looks like this:


PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
ENV=$HOME/.bashrc
USERNAME="root"
export USERNAME ENV PATH

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi



as user, echo $PATH yields the following:

/usr/local/qt/bin:/usr//bin:/bin:/usr/bin::/usr/local/bin:/usr/X11R6/bin:/usr/games:/home/henry/bin

while as root, echo $PATH yields this:

/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin


As you can see, my user path is severely messed up, while the root path, while not messed, doesn't have the qt component.

Can anyone shed any light on this mess?

TIA for any help
 
Old 08-15-2003, 11:16 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
There is one thing I noticed from looking thorough in /root/.bashrc you've got

PATH = /sbin:/usr/sbin etc...

but no $PATH so that will wipe out any other settings for PATH.

you need to add it

PATH = $PATH:/sbin:/usr/sbin etc...

If you want all the other settings to be added to roots path. Ithink it sets up this way for security.

As for the users path something else is adding to the path, I can't see where the rest of its coming from.

Have you checked /etc/bash.bashrc or other bash files?

Do you have any other code adding to your path?

Last edited by leonscape; 08-15-2003 at 11:20 PM.
 
Old 08-15-2003, 11:43 PM   #3
donald_lam
LQ Newbie
 
Registered: Aug 2003
Distribution: Mandrake 9.1
Posts: 2

Original Poster
Rep: Reputation: 0
"you need to add it

PATH = $PATH:/sbin:/usr/sbin etc..."

Thanks, that helps for that. As far as other code adding to the path, that was my thought as well, but I'm out of ideas as to where it might be coming from.....

"Have you checked /etc/bash.bashrc or other bash files?"

I don't have /etc/bash.bashrc--should I have? In /etc I have only bashrc. Sorry to be such a noob

Last edited by donald_lam; 08-15-2003 at 11:48 PM.
 
Old 08-15-2003, 11:54 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
Try doing a search through /etc/ for PATH see what files come up.

Also do this on the home directory as well.

If your running KDE theirs find files in utilities.

Although this won't work if your not root.

Last edited by leonscape; 08-15-2003 at 11:59 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with $PATH halfpower Linux - Newbie 4 08-30-2005 01:49 PM
Problem with path kvelan SUSE / openSUSE 2 07-26-2005 01:06 PM
problem with the PATH (help) vlad ilie Linux - Newbie 1 10-05-2004 06:45 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM
PATH problem? makai_wi Linux - Newbie 18 11-12-2002 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:02 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