Suresh Ramasubramanian wrote:
> Better than adding it to /etc/profile - $DISPLAY need be exported only when
> you fire up a remote xterm, rather than just ssh / telnet into the machine.
Well if it's a remote exterm, then it's good to set the display to machine
name:0. Machine name can be obtained as last field of who -u. Something 'who
-u|grep tty| cut -f<last fields>' should do the trick.
>From .profile of our HP machines..
-----------------------------------------------------------------------------
Thistty=`tty | sed 's:^/dev/::'`
dis=`
who -u |
awk -v Thistty=$Thistty '$2 == Thistty {print $8}' |
sed 's/:.*$//'
`
if [ -z "$dis" ]; then
unset DISPLAY
else
export DISPLAY=$dis":0.0"
fi
echo "DISPLAY=$DISPLAY"
-----------------------------------------------------------------------------
This is bit lengthier than I expected but works. God knows who hacked this...
>
> --suresh
Shridhar
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/linux-india-help