DISPLAY environment variable from login(1)

David Elliott dce at Solbourne.COM
Thu Sep 7 07:04:03 AEST 1989


In article <4599 at ogccse.ogc.edu> schaefer at ogccse.UUCP (Barton E. Schaefer) writes:
>So, you create a front-end script on the local machine that looks like
>
>    #! /bin/sh -
>    TERM="$TERM.$DISPLAY" ; export TERM
>    exec /path/to/real/rlogin ${@+"$@"}
...
>If the value of $DISPLAY is particularly long, this may run into problems
>with the lenght of the string that rlogin will pass as $TERM.  However,

The solution outlined here is quite reasonable in many cases, and I
used it for about a day.

There are two problems with it, though.

One is outlined above, that being the problem of long values of
DISPLAY.  This is not really a problem in practice, since the
array used to store the data is 64 characters.  Assuming xterm
for the terminal type and 6 characters to pass the screen size,
you are left with 52 characters for $DISPLAY.  Given that there
still exist programs that hardcode the number 32 for the maximum
hostname length (the number in 4.3BSD is defined by MAXHOSTNAMELEN,
which is 64), it's not too likely that you'll run into this problem.

The other problem I outlined in my posting.  Using the above scheme,
if you rlogin to a machine for which you have no home directory,
and thus no .login/.profile that will rebuild the variables, you
end up setting your TERM variable by hand.

Either method will work fine, though.

-- 
David Elliott		dce at Solbourne.COM
			...!{uunet,boulder,nbires,sun}!stan!dce

"We don't do this because we love you or like you...we don't even know you!"



More information about the Comp.unix.questions mailing list