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