Thanks Gordon & Eric, this is a bit more clear now except for two things:

1)  Where does DISPLAY get set for a normal user ?

2)  Why does DISPLAY NOT get set for root ?

Mike

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Gordon Messmer
Sent: Saturday, January 08, 2000 3:08 PM
To: [EMAIL PROTECTED]
Subject: Re: DISPLAY env


Mike Lewis wrote:
> Also, is the reason there is a difference between the behavior of 'su' and
> 'su -' with regard to DISPLAY is that the 'su' would inherit the DISPLAY
env
> from Joe, where as  root has no DISPLAY env ?  What's the reason for root
> not having a DISPLAY env ?

Yes, there is a reason.  su gives you the euid (effective user id) of a
given user (not necessarily root). su - gives your the euid and
environment of a given user.  In order to have the "correct"
environment, su doesn't inherit any of your environment.

For instance, log in to a console vt sometime.  Notice that there is no
DISPLAY set.  Since you aren't logged in to X, no DISPLAY is really
appropriate.  If you had one, programs like emacs would try to connect
to a DISPLAY that you aren't in, and fail.  "su -" should give you an
environment similar to this one.

On my machines, I have "alias heraldx='export DISPLAY=herald:0.0'" in my
.bashrc.  It's shorter by a lot, and bash can tab autocomplete heraldx.

MSG


--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to