LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-31-2006, 10:08 PM   #1
W0bbles
LQ Newbie
 
Registered: Feb 2005
Distribution: Slackware 10
Posts: 27

Rep: Reputation: 15
Question Very strange $PATH variable problem -- Desperate for HELP!


I have reinstalled slack 10.2 about 3 times now trying to fix this problem. I don't have any .bashrc or .bash_profile files in my root directory or in my personal /home directory. This is strange. When I am logged into my personal account on KDE, here is my $PATH directory:

Code:
matt@slack:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.
Here is my root $PATH after doing 'su':
Code:
matt@slack:~$ su
Password:
root@slack:/home/matt# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
Now I log into my root account w/ KDE. Here is my $PATH for root.
Code:
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/crap:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
So here is what the $PATh variable is in my /etc/profile:
Code:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"
So here is how I interpret this. When I am logged into my personal account (/home/matt), the /etc/profile defined $PATH variable is, /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games". Then it looks like, /opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin, is being added to the end of the $PATH variable when I log into my personal account.

When I am logged into my root account using 'su', the $PATH variable is this, /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin. But when I log into my root KDE session, this is the $PATH variable, /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/crap:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin. So again, /opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin, is being added to the end of my $PATH variable.

I can modify the $PATH variable in /etc/profile by adding to the end of it /crap. Here it is now:
Code:
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/crap:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.
Anyone else getting a headache?! This is a Slackware problem ONLY. I installed Fedora Core right over Slackware and it didn't have any of these problems. Then I thought I cured the problem, so I reinstalled Slackware again, and it is still happening!!!

Can anyone help? Anyone?
 
Old 01-31-2006, 10:47 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 3,018

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
These two articles should answer your questions:

http://www.slackworld.net/01/tips.html

http://rootprompt.org/article.php3?article=9144
 
Old 01-31-2006, 11:24 PM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
If you use the command 'su -' rather than 'su' your $PATH should be the same as when you log in as root. Just using 'su' doesn't preserve your path.
Same for switching from root to user: eg I would use 'su - dave' rather than 'su dave'
 
  


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
PATH variable suavecu Linux - Software 11 01-28-2006 12:44 AM
I have a strange problem with $PATH.. PAOLO_GRS Linux - Software 4 03-30-2004 05:25 AM
the path variable mjkramer Linux - Newbie 4 10-18-2003 07:18 AM
help with strange path problem please... scottyman Linux - Software 0 01-31-2003 03:17 AM
RedHat 7.3 PATH env variable problem NewRedHatter Linux - Newbie 4 09-01-2002 05:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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