LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-11-2003, 01:38 PM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
PATH changes for no reason?


I just installed slackware 9.1 . First I want to say it was surprisenly easy. I got my X working in a day. I have just been using redhat 2 months prior. I would recommend this distro to any new linux users who want to learn.

Here is my problem. If a change from su to regular user in the terminal my path changes. Or if I change from regular used to su my path changes. The only way I can get my full path to come back is to start an other terminal session.

below is a is an example.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
shane@marsala:~$ $PATH
-bash: /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-3.2.1/bin:/usr /share/texmf/bin:.: No such file or directory
shane@marsala:~$ su
Password:
root@marsala:/home/shane# $PATH
bash: /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin: No such file or directory
root@marsala:/home/shane# su shane
shane@marsala:~$ $PATH
bash: /usr/local/bin:/bin:/usr/bin: No such file or directory
shane@marsala:~$
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This happens the reverse way also if I start as root and change to user
 
Old 10-11-2003, 03:04 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"If a change from su to regular user in the terminal my path changes. Or if I change from regular used to su my path changes. The only way I can get my full path to come back is to start an other terminal session."

It is normal for root, su, and user to have different PATHs. You can change the PATH for user and root in .profile or .bashrc. I have never bothered to find where PATH is set for su. If you find out let me know.

To add directories to the path add the following command to /home/user/.bashrc

export PATH=$PATH:/my/extra/command/directory

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 10-11-2003, 03:37 PM   #3
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
I know the path is different between user and root. My root path is changeing. take a look at my example above.
 
Old 10-11-2003, 03:53 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,863

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
This is normal. su root does not necessarily get the same PATH as root. su shane does not necessarily get the same PATH as shane. All of this is configurable somewhere but I have never bothered to look up how to configure it.

If you want to go from shane to root to shane try:
su
password
.
.
.
.

exit



___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Last edited by jailbait; 10-11-2003 at 04:54 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
Image Path reference in Linux (Absolute path) javabuddy Linux - General 7 06-05-2006 08:45 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 06:07 AM
what will be the reason digitalj Linux - Software 6 08-11-2005 10:09 AM
Removing path form PATH maginotjr Linux - Newbie 3 02-12-2005 03:23 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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