?
Solved

setting DISPLAY

Posted on 1997-04-11
4
Medium Priority
?
224 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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