The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Auto Login to Open Windows nvanduyne SUN Solaris 1 06-15-2006 11:56 AM
UNIX Auto-login nvanduyne UNIX for Advanced & Expert Users 1 06-15-2006 10:16 AM
freebsd auto login user at boot / i'm stuck termiEEE UNIX for Dummies Questions & Answers 6 02-26-2004 01:18 PM
Auto Login merlin UNIX for Dummies Questions & Answers 1 11-20-2002 12:01 PM
Auto login? merlin UNIX for Dummies Questions & Answers 4 02-26-2002 12:43 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2008
BearCheese BearCheese is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 10
Auto X when Login

Hi All,
We have some HP unix servers and sometimes we logon there thru a dedicated Windows server that has Reflection X on it in case we need X. In this case we always need to export DISPLAY=winservername:0.0

I want to automate this thing in .profile file. If e.g. $TERM = hpterm (thru reflection X) then it should automatically export DISPLAY. (I found out that TERM=hpterm always indicates if we logon thru the windows server, because otherwise it is just set to "hp". So I can use this condition)

It's all OK, I can do that. But I came across an issue when e.g. I logon to the windows server as the first person and open a reflection X then DISPLAY should be sever:1.0
But when another chap comes thru this windows server and opens a reflection X session then he must export DISPLAY=winserver:2.0.

So it seems this number is increasing with any further parallel sessions get opened from the Windows machine.

Is there any way or UNIX command how I can find out what this number should be after the server? Then I can really automate this DISPLAY export and it would not only work for the first user who opens an X session.

So I need something like this:
if $TERM = "hpterm" then export DISPLAY=winserver:$n.0

and I need to know how $n can be determined for the given session.

Cheers
  #2 (permalink)  
Old 08-26-2008
vbe's Avatar
vbe vbe is online now Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,575
Very tricky what you are asking since I never tried to use RX from a Winserver...
but from what I know of the product when you try a connection the script lauched by Rx to open a session on a server looks like:
(/usr/bin/X11/dtterm -display %IP#% -name %T% &)
which would get your pc's IP and open a dtterm...
What you are doing is a bit different since you are a few opening on the same Winserver a new Xserver instance thus the :1.0, :2.0 etc
You should remember that if RX can open multiple instances, there is a limit...
Go and see attachmate's site if you can find some documention there or try to get some support
  #3 (permalink)  
Old 08-26-2008
mr_manny mr_manny is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 144
add the following to the unixID's .profile

if tty -s; then
DISPLAYHOST=$(who -muR | awk '{print $NF}')
DISPLAYHOST=${DISPLAYHOST%%:0.0}
DISPLAY=$DISPLAYHOST:0.0; export DISPLAY
echo "DISPLAY has been set to $DISPLAY"
fi


try it, you'll like it
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0