Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
whoami and USER disagree
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
thomasdideriksen
n00b
n00b


Joined: 21 Jun 2004
Posts: 9
Location: Denmark

PostPosted: Tue Aug 02, 2005 3:21 pm    Post subject: whoami and USER disagree Reply with quote

After an "emerge --update world --deep" I experience a strange problem:

When I log into my root account using "su", the USER environment variable somehow fails to update:

Code:

thomas@krakatau64:~> su
Password:
krakatau64 thomas # whoami
root
krakatau64 thomas # echo $USER
thomas
krakatau64 thomas #


It is annoying, because the PATH env. variable depends on the USER env. variable... Thus, /sbin is not included in the PATH for the root-user (I know this is a minor issue, but anyway...)

Does anyone know how to solve this matter?
Back to top
View user's profile Send private message
msalerno
Veteran
Veteran


Joined: 17 Dec 2002
Posts: 1338
Location: Sweating in South Florida

PostPosted: Tue Aug 02, 2005 3:30 pm    Post subject: Reply with quote

When doing an "su" use

# su -

man su:
...
The optional argument - may be used to provide an environment similiar to what the user would expect had the user logged in directly.
...
Back to top
View user's profile Send private message
thomasdideriksen
n00b
n00b


Joined: 21 Jun 2004
Posts: 9
Location: Denmark

PostPosted: Tue Aug 02, 2005 3:34 pm    Post subject: thanks! Reply with quote

Thanks! ... I didn't know that option... :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum