home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / misc / 210 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.0 KB  |  55 lines

  1. Newsgroups: comp.sys.sgi.misc
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!sdd.hp.com!saimiri.primate.wisc.edu!ames!agate!linus!philabs!acheron!scifi!watson!yktnews!admin!minnie!gerth
  3. From: gerth@watson.ibm.com (John Gerth)
  4. Subject: Re: How can I rlogin with the DISPLAY envar propagated?
  5. Sender: news@watson.ibm.com (NNTP News Poster)
  6. Message-ID: <1993Jan08.024656.34352@watson.ibm.com>
  7. Date: Fri, 08 Jan 1993 02:46:56 GMT
  8. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  9. References: <1993Jan8.000124.1271@sol.ctr.columbia.edu>
  10. Nntp-Posting-Host: minnie.watson.ibm.com
  11. Organization: IBM T.J. Watson Research Center
  12. Lines: 41
  13.  
  14. Instead of using 'rlogin', you can use 'rsh' to start an 'xterm'
  15. on the target system propagating your current DISPLAY variable.
  16. Since the new 'xterm' will be operating against the server at
  17. the DISPLAY variable all the customizations will apply.
  18.  
  19. Now there are lots of ways to do this.  Attached is a 'ksh' script
  20. I use to do it on Irix 4.0.5 and which may well need to be customized
  21. to your own tastes:
  22. *-*-*-*-* cut here *-*-*-*
  23. #!/bin/ksh
  24. #
  25. #  start a remote xterm with args, e.g. "rx over_there -bg seagreen ...."
  26. #
  27. #  $1 has the remote host name 
  28. #
  29.  
  30. rx=$1; shift;
  31. # I usually run with 'xhost +'. If you do too, comment out the following
  32. xhost +$rx
  33.  
  34. # use /usr/bsd/hostname to get current host. An alternative is to use
  35. #  an environment variable with your normal home workstation.  The latter
  36. #   permits one to use this script again from 'rx'
  37. #   
  38. xh=`hostname`
  39.  
  40. # now spawn the login  
  41. rsh $r . .profile \; xterm -ls -display $xh:${DISPLAY#*:} $* &
  42.  
  43. # NOTES:
  44. #  (1)  running .profile gets the PATH, etc. setup over there
  45. #           but assumes that one uses bsh or ksh on the remote.
  46. #  (2)  The goop with DISPLAY handles the general case of
  47. #          X display names, e.g. on multi-headed systems where
  48. #          it can look like "unix:1.2".  We only want the "1.2".
  49.  
  50. *-*-*-*-* cut here *-*-*-*
  51.  
  52.  
  53. -- 
  54. John Gerth     gerth@watson.ibm.com        (914) 784-7639
  55.