LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   # su does not update path (https://www.linuxquestions.org/questions/debian-26/su-does-not-update-path-195994/)

tvn 06-21-2004 10:21 AM

# su does not update path
 
when I 'su' to root, the $PATH is not set . How to fix this ?

$ su // $PATH is unset
Password:
# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin

# su - // $PATH is set fine here
# echo $PATH
/usr1/bin:/opt/Software/Multimedia/RealPlayer:/opt/Software/Development/Java/jsk/bin:/root/bin:/sbin:/usr/sbin:/usr/local/sbin/:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/root/kde3.2.3/bin

fluppi 06-21-2004 12:59 PM

What do you want to fix, it's running perfectly:
"su" = change only the user, without a name it's root
"su -" = change user and load his environment, without a name it's root

tvn 06-21-2004 11:18 PM

when doing just 'su' , it should inherit the user's environments and variables - correct ?

fluppi 06-22-2004 02:11 AM

Yes, but I wouldn't say inherit, just "su" changes nothing except the username and allow you doing things in his name with his permissions.


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