Solved

setting DISPLAY

Posted on 1997-04-11
4
220 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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

821 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