![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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 ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|