Solved

setting DISPLAY

Posted on 1997-04-11
4
221 Views
Last Modified: 2013-12-16
Is there a way for a .login/.profile/.*shrc to autmatically
assign $DISPLAY so that X-windows go to the original login
monitor?  When answering, consider that I have already seen
four solutions and each has one of the following flaws:
1. Not portable to all Unices.
2. Hard-coded to the user's "usual" host.
3. In the case of chained rlogins, doesn't get all the way
   back to the original host; picks a machine in between.
4. Works usually, but depends on the format of something
   like 'ps' or 'who' or 'w', etc. and screws up when
   the output format varies (which happens sometimes).
0
Comment
Question by:Bill_West
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 

Accepted Solution

by:
barnish earned 100 total points
ID: 1812011
Have you thought of using xrsh rather than rlogin.
This command sets the DISPLAY variable for you as you login, and thus works along chained rlogins. There is a version available for all Unices and it works from any host.
Thus this solution satisfies those flaws in other solutions.

The only problem is this solution will bring up a new window for each new login...

0
 

Author Comment

by:Bill_West
ID: 1812012
Well, bringing up a new window each time is a slight
disadvantage, but the fact that it's consistent makes it
better than everything I've tried so far.  I'll try it
before I score it, but it sounds good.....
0
 

Author Comment

by:Bill_West
ID: 1812013
Oops - back again.  Too many search hits to wade through.
Where would I find HPUX RISC, HPUX non-RISC, and
SPARC/Solaris versions?
0
 

Author Comment

by:Bill_West
ID: 1812014
Never mind, I tracked it down.  Looks good, and
since it's a script, portability is OK.

I was going to score this 'C' due to the drawback of
getting a new window on every hop, and also the
disadvantage that it doesn't work unless you use it
exclusively, e.g., if I login to mercury, rlogin to
venus, from there xrsh to saturn, and on saturn invoke
'the_X_tool_from_hell' I will either get an X error
or nothing at all.  

However, since xrsh and xrlogin are scripts, I can
'borrow' the mechanism they use to transfer $XHOST
and $DISPLAY and build it into my .profile (or
equivalent). This lets me raise the score to 'B'.  
A 'plug-n-play' answer would have scored an 'A' (if
it worked).

Thanks!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question