LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Path problems (https://www.linuxquestions.org/questions/slackware-14/path-problems-522981/)

dave811 01-26-2007 07:11 AM

Path problems
 
I've just installed Slackware 11.0 and it's my first attempt to seriously replace Windows. I've dabbled in Linux before but I'm a newbie.

This is baffling me. I can start X as root using the startx command but if I su to another user it tells me "Command not found". Then if I su back to root it gives me the same error even though it worked before changing users.

/etc/profile contains:

PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"

but when I type "echo $path" it just returns a blank line.

Am I missing something obvious here?

KleB 01-26-2007 07:52 AM

It's because su starts another instance of bash. And it does _not_ run your profile. If you want to read the profile, I think that command "su -" does the job.

lord-fu 01-26-2007 07:56 AM

Instead of "echo $path"
try
"echo $PATH" instead.
Hope that helps some. Really shouldn't be starting X as root though ;]

dunric 01-26-2007 10:42 AM

Quote:

Originally Posted by lord-fu
Instead of "echo $path"
try
"echo $PATH" instead.
Hope that helps some. Really shouldn't be starting X as root though ;]

Because it's run with suid root privileges anyhow ;)

dave811 01-26-2007 11:32 AM

I'm not really sure what was wrong but deleting and readding the user account fixed the problem.

Thanks for the su - user tip, I had no idea it didn't load your profile.

H_TeXMeX_H 01-26-2007 07:07 PM

And remember ... Linux is case-sensitive ... unlike some other OSs.


All times are GMT -5. The time now is 05:44 PM.