View previous topic :: View next topic |
Author |
Message |
emerge_me n00b
Joined: 19 Apr 2005 Posts: 59 Location: Alicante, España
|
Posted: Sat Apr 23, 2005 8:27 pm Post subject: Bash forgets enviroment variables when I do "su" |
|
|
Every time I do a "su" to change user, varialbes like PATH are not the same and others are gone. I don't want to do "source /etc/profile" every time I change user.
example:
Code: |
bash-2.05b$ echo $PATH
/usr/kde/3.3/bin:.:.:/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130:/opt/sun-jdk-1.4.2.08/bin
:/opt/sun-jdk-1.4.2.08/jre/bin:/opt/sun-jdk-1.4.2.08/jre/javaws:/usr/qt/3/bin:/usr/kde/3.3/bin
bash-2.05b$ su
Password:
bash-2.05b# su arturo
bash-2.05b$ echo $PATH
/usr/local/bin:/usr/bin:/bin
|
unmasking bash and installing the version 3 would help? |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sat Apr 23, 2005 8:41 pm Post subject: |
|
|
You probably want to run _________________ KDE |
|
Back to top |
|
|
emerge_me n00b
Joined: 19 Apr 2005 Posts: 59 Location: Alicante, España
|
Posted: Sat Apr 23, 2005 8:47 pm Post subject: |
|
|
Thank you very much. It worked perfectly.
I'm used to Mandrake and I've never had a problem with "su", I don't really know the difference between "su" and "su -". |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sat Apr 23, 2005 8:59 pm Post subject: |
|
|
The difference is documented in the manpage. Maybe Mandrake has an alias that makes su become su -. Hm, probably not.
man su wrote: | The optional
argument - may be used to provide an environment similiar to what the
user would expect had the user logged in directly. |
_________________ KDE |
|
Back to top |
|
|
emerge_me n00b
Joined: 19 Apr 2005 Posts: 59 Location: Alicante, España
|
Posted: Sat Apr 23, 2005 10:29 pm Post subject: |
|
|
Thanks, I've tried it in Mandrake and it's the same, excep that when I use "su", the PATH is more complete, that's why I've never noticed that I made something wrong.
Next time I'll try to remeber to read the man first . I thought there was something wrong with bash and not with the su options . |
|
Back to top |
|
|
|