Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting the DISPLAY upon logon automagically

Status
Not open for further replies.

snooperx

Technical User
Jul 4, 2001
15
0
0
BR
Hello all.

What would be a nice script for exporting the DISPLAY from the originating user´s machine after he telnets to a box?

I already got one working on AIX, but on HP-UX the ´who´ produces an output withou an IP address that I could export.
Any hints?

Thanks!
Jeffo.

Sample AIX Script:

export DISPLAY=`who am i|cut -d "(" -f 2|tr -d ")"|tr -d " "`:0.0
echo $ECHO_ARG "\nDISPLAY=$DISPLAY\n\n"

 
Rather depends on what you're doing, but you might try using this command.......

(/usr/bin/X11/hpterm -fn 6x13 -sb -ls -display %IP#% -name %T% &)

or you might be stuck with "who am i" and searching through "who -u" for your ttyp? and hence you IP address or hostname.

 
Hello!
Actualyl I´m trying to export the DISPLAY VARIABLE from the originating box. That´s all, so that, if the user runs SAM for example, the display would be already exported.

I think I´ll have to "be stuck with who am i"...
 
Holy moly!

I found out the "-R" option along with ´who am i´, so I can use the SAME script for AIX I´ve posted up there...
Like this:

------------------------------------
export DISPLAY=`who am i -R |cut -d "(" -f 2|tr -d ")"|tr -d " "`:0.0
echo $ECHO_ARG "\nDISPLAY=$DISPLAY\n\n"
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top