LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 10-24-2003, 07:58 PM   #1
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
$PATH!? how to set these PATH(s)!?


hihi, i'm new to this so may sound a bit stupid

i'm trying to set PATH on my rh9,
i'm using bash
i used vi to edit the following

files: .bashrc, .bash_login, .bash_profile,

none of those appear to work,
so everytime when i wanna add path

i have to do that PATH=$PATH:/sbin deals, which real annoying,
would anyone plz tell me which file i can edit my path for root, and which file i can edit my path for user? ^_^


thank you

p.s: how come on rh9, when running root, /sbin or /usr/sbin isn't in part of the PATH!?!?!


sirpelidor
 
Old 10-24-2003, 08:54 PM   #2
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
Add a line to .bash_profile
PATH=$PATH:/sbin

Are you logging in as root or using the su command?
If you use su, /sbin will not be in your path. You have to
su -
 
Old 10-24-2003, 09:04 PM   #3
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
If your using bash I *think* it needs to be

PATH="$PATH:/sbin";export PATH
(quotes and export)

and it should be in both .bashrc and .bash_profile or you have to keep up with whether it's a login shell or not.

Could easily be wrong, though. It does help to include exactly what you typed in your message rather than saying you 'edited' a file, though, because 'edit' can mean a lot of things. *g*

And it doesn't sound stupid at all. Windows users rarely have to mess with paths and DOS users could set it up a bit easier, so it can be a stumbling block in Linux.
 
Old 10-24-2003, 09:23 PM   #4
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
How I wrote it above is the same syntax I've used in my .bash_profile. Works for me
 
Old 10-24-2003, 09:48 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Okay. And mine works for me, so now we know there's some flexibility there. Yours is definitely shorter and better, though.
 
Old 10-25-2003, 04:00 PM   #6
sirpelidor
Member
 
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Original Poster
Rep: Reputation: 30
ha ha
now i know what i did wrong, the reason /sbin wasn't show was because i was doing su, not su -

when doing su -

/sbin shows on my path, thank you
 
  


Reply



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
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM
9.1 set $PATH seingoku Slackware 6 02-06-2004 03:12 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM
Set Path reaky Linux - Newbie 2 10-09-2003 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:06 PM.

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