Subject: Re: setenv DISPLAY for remote (again)

From: [email-masked] (Markus Baumeister)
Date: 29 Sep 1993 15:21:31 GMT

In <[email-masked]> [email-masked] (thorbjorn willoch) writes:

>On my Solaris 2.2 box "who am i" works fine to give info about where I
>logged in from EXCEPT if my username is eight characters long, then
>that information is lost!

Well, since many of our usernames are eight chars long, we had
similiar problems as the original poster. Finally I found some code
in an AnswerBook-script, which seems to solve the problem.
(Perhaps Sun should do something about this bug)

Try this in your .login file (no guarantue or whatever):

   # and finally InfoV proudly presents: automatic setting of
   # DISPLAY even under Solaris   (MB)
   set tty=`/bin/tty | sed 's,/dev/,,g'`
   set rehost=`/bin/who | grep $tty'.*(.*)$' | sed -e 's,.*(,,g' -e 's,).*,,g'`
   /bin/who | grep -s $tty'.*(.*)$' >/dev/null
   if( $status == "0" ) setenv DISPLAY  "${rehost}:0"
   unset tty
   unset rehost

Hope this helps
	Markus Baumeister
-- 
Markus Baumeister, EMail: [email-masked]