<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script to export the DISPLAY between two machines in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769317#M260930</link>
    <description>Any help plz ?</description>
    <pubDate>Tue, 11 Apr 2006 16:26:51 GMT</pubDate>
    <dc:creator>Mark_541</dc:creator>
    <dc:date>2006-04-11T16:26:51Z</dc:date>
    <item>
      <title>Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769307#M260920</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I would like to know if any one has an idea how to export (via script) the DISPLAY of machine A to another machine B (using, SSH, Telent or Expect).&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance</description>
      <pubDate>Mon, 10 Apr 2006 12:56:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769307#M260920</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-10T12:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769308#M260921</link>
      <description>ssh by default will pass the current setting for DISPLAY on machine A to machine B.&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Mon, 10 Apr 2006 13:47:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769308#M260921</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-04-10T13:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769309#M260922</link>
      <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;Are you sure ?&lt;BR /&gt;&lt;BR /&gt;Personally, I do not think so..</description>
      <pubDate>Mon, 10 Apr 2006 13:53:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769309#M260922</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-10T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769310#M260923</link>
      <description>Not sure what you mean by exporting the DISLAY environment variable.&lt;BR /&gt;&lt;BR /&gt;What I do, issue the command 'who -um' and this will give a 1 line response. The last field is the IP/host you are coming from.&lt;BR /&gt;&lt;BR /&gt;export DISPLAY=`who -um | awk '{print $NF}'`:0&lt;BR /&gt;&lt;BR /&gt;I put this in the .profile&lt;BR /&gt;&lt;BR /&gt;If it resolves then you get the host name. If you are on a Linux system, the IP address will be enclosed in parenthesis, use the 'tr -d ()' command to get rid of the parenthesis.&lt;BR /&gt;&lt;BR /&gt;All of this is done within the $HOME/.profile so the DISPLAY is set once you log in. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Apr 2006 13:59:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769310#M260923</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2006-04-10T13:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769311#M260924</link>
      <description>Do a "man ssh". This is a section on X11 processing-&lt;BR /&gt; &lt;BR /&gt;If the ForwardX11 variable is set to ``yes'' (or, see the description&lt;BR /&gt;of the -X and -x options described later) and the user is using X11&lt;BR /&gt;(the DISPLAY environment variable is set), the connection to the X11&lt;BR /&gt;display is automatically forwarded to the remote side in such a way&lt;BR /&gt;that any X11 programs started from the shell (or command) will go&lt;BR /&gt;through the encrypted channel, and the connection to the real X server&lt;BR /&gt;will be made from the local machine.  The user should not manually set&lt;BR /&gt;DISPLAY.  Forwarding of X11 connections can be configured on the&lt;BR /&gt;command line or in configuration files.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 10 Apr 2006 14:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769311#M260924</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-04-10T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769312#M260925</link>
      <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;I have machine 1: echo $DISPLAY  &amp;gt;&amp;gt; 1.2.3.4 (for instance).&lt;BR /&gt;&lt;BR /&gt;I would like from machine 1 connect via SSH to machine 2 and do: export DISPLAY=1.2.3.4 (export the display of machine 1 to machine2)&lt;BR /&gt;&lt;BR /&gt;BR</description>
      <pubDate>Mon, 10 Apr 2006 14:06:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769312#M260925</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-10T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769313#M260926</link>
      <description>Hey Mark,&lt;BR /&gt;&lt;BR /&gt;This would do the export if you are at display 0 from server one:&lt;BR /&gt;&lt;BR /&gt;ssh server 2:&lt;BR /&gt;Execute command:&lt;BR /&gt;export DISPLAY=`who -um | awk '{print $8}' | tr -d '()'`:0.0&lt;BR /&gt;&lt;BR /&gt;Test it with:&lt;BR /&gt;xclock&lt;BR /&gt;&lt;BR /&gt;But you could enable X-forward in ssh (if you config are at /etc/ssh):&lt;BR /&gt;vi /etc/ssh/sshd_config&lt;BR /&gt;# X11 tunneling options&lt;BR /&gt;X11Forwarding yes&lt;BR /&gt;X11DisplayOffset 10&lt;BR /&gt;&lt;BR /&gt;Then restart you sshd deamon on the changed system. You may need to change X11 options on the connecting server as well.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jannik&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Apr 2006 16:06:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769313#M260926</guid>
      <dc:creator>Jannik</dc:creator>
      <dc:date>2006-04-10T16:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769314#M260927</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;In addition the the sshd_config:X11Forwarding yes mentioned in the previous post, ensure the ssh_config:ForwardX11 yes is also set.  The one in the sshd_config tells the daemon whether or not it's possible, the one in ssh_config determines whether it's on by default.  That can be tweaked by user in a ~/.ssh/config file if needed.&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Mon, 10 Apr 2006 16:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769314#M260927</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2006-04-10T16:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769315#M260928</link>
      <description>Hi Mark,&lt;BR /&gt;&lt;BR /&gt;this is some code of my multi-OS profile concerning the DISPLAY variable. You should run this piece of code only, when you have a tty, so put it in block like&lt;BR /&gt;if [ -t 1 ]&lt;BR /&gt;then&lt;BR /&gt;...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#### START&lt;BR /&gt;get_os () { OSs=$1; HOST=$2; OSr=$3 ;}&lt;BR /&gt;get_os `uname -snr`&lt;BR /&gt;export HOST OSs OSr&lt;BR /&gt;&lt;BR /&gt;if [ -z "$ENVONLY" ]  # SGIonly&lt;BR /&gt;then&lt;BR /&gt;tty=`tty | awk -F/ '{if ($NF ~ "tty") print(substr($NF,4,length($NF)-3))&lt;BR /&gt;else print $NF}'`&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;case $OSs in&lt;BR /&gt;HP-UX)&lt;BR /&gt;if [ "$tty" = con ]&lt;BR /&gt;then remhost=&lt;BR /&gt;else remhost=`who am i -R | awk '{print(substr($NF,2,length($NF)-2))}'`&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;DomainOS)&lt;BR /&gt;if [ "$tty" = display ]&lt;BR /&gt;then remhost=&lt;BR /&gt;else remhost=`who am i | awk "/$tty /"' {print $NF}'`&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;SUN*)&lt;BR /&gt;remhost=`finger -fhmpsw $LOGNAME | awk "/$tty /"' {print $NF}'`&lt;BR /&gt;;;&lt;BR /&gt;IRIX*) remhost=$REMOTEHOST&lt;BR /&gt;;;&lt;BR /&gt;Linux) remhost=`who am i | awk '{print(substr($NF,2,length($NF)-2))}'`&lt;BR /&gt;;;&lt;BR /&gt;SCO*)remhost=`who -mx | awk '{print $NF}'`&lt;BR /&gt;;;&lt;BR /&gt;*)&lt;BR /&gt;remhost=`finger -fhmpsw $LOGNAME | awk "/$tty /"' {print $NF}'`&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;# post-processing of remhost&lt;BR /&gt;case "$remhost" in&lt;BR /&gt;'')    remhost=localhost&lt;BR /&gt;       disp=:0.0 ;;&lt;BR /&gt;*:0.0) disp=$remhost&lt;BR /&gt;       remhost=${remhost%:*} ;;&lt;BR /&gt;*:*)   remhost=${remhost%:*}&lt;BR /&gt;       disp=$remhost:0.0 ;;&lt;BR /&gt;*.*)   remhost=${remhost%%.*}&lt;BR /&gt;       disp=$remhost:0.0 ;;&lt;BR /&gt;*)     disp=$remhost:0.0 ;;&lt;BR /&gt;esac&lt;BR /&gt;DISPLAY=${DISPLAY:-$disp}&lt;BR /&gt;# or overide:&lt;BR /&gt;# DISPLAY=$disp&lt;BR /&gt;&lt;BR /&gt;export DISPLAY&lt;BR /&gt;#### FINI&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 11 Apr 2006 10:23:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769315#M260928</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-04-11T10:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769316#M260929</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I think there are a miss-understanding of the problem. Let me explain you the situation:&lt;BR /&gt;&lt;BR /&gt;1/Server1 (where I am logged as user1) from PC: echo $DISPLAY gives 1.2.3.4:0.0&lt;BR /&gt;&lt;BR /&gt;2/ Server2 (where I would like to connect as user2 via SSH without password and export the display to the same value as server1). Some thing like: export DISPLAY=1.2.3.4:0.0&lt;BR /&gt;&lt;BR /&gt;3/ server1-user1# ssh user2@server2 script&lt;BR /&gt;&lt;BR /&gt;==&amp;gt; So, as user1 at server1, I will connect via SSH to server2 as user 2 (without password) : this step is OK.&lt;BR /&gt;&lt;BR /&gt;Then I would like to export the DISPLAY of server2/user2 to the same value as user1/server1.&lt;BR /&gt;&lt;BR /&gt;Note: 1.2.3.4 may changes depending on the PC I am using.&lt;BR /&gt;&lt;BR /&gt;Hope now it is well explained&lt;BR /&gt;&lt;BR /&gt;Thx in Advance</description>
      <pubDate>Tue, 11 Apr 2006 14:42:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769316#M260929</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-11T14:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769317#M260930</link>
      <description>Any help plz ?</description>
      <pubDate>Tue, 11 Apr 2006 16:26:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769317#M260930</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-11T16:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769318#M260931</link>
      <description>Sounds as if you are needing to parse the output of 'who -u' command. (As opposed to the 'who -um command which will only This command will list all connections to a server including the IP/hostname.) &lt;BR /&gt;&lt;BR /&gt;who -u | grep user1 | awk '{print $NF}' | tr -d ()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Parse the relevant info from the connection of user1/server1 and pass that to the export DISPLAY for user2/server2.&lt;BR /&gt;&lt;BR /&gt;Again, this can be included in the .profile so it will execute on login. Can also make it a standalone script.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Apr 2006 16:41:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769318#M260931</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2006-04-11T16:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769319#M260932</link>
      <description>Yeah but may be there are many users connected to server2 using the same login&lt;BR /&gt;&lt;BR /&gt;BR</description>
      <pubDate>Tue, 11 Apr 2006 17:13:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769319#M260932</guid>
      <dc:creator>Mark_541</dc:creator>
      <dc:date>2006-04-11T17:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script to export the DISPLAY between two machines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769320#M260933</link>
      <description>The who -u command will list out the all the users currently connected. It will also list your specific session. Granted there may be many users with the same login but there will only be 1 line that describes your specific login session - this line provides the IP or host name at the end.&lt;BR /&gt;&lt;BR /&gt;root       pts/1        Apr 13 08:48  0:11   1337       (1.2.3.4)&lt;BR /&gt;root       pts/2        Apr 13 08:49  0:10         1338       (1.2.3.5)&lt;BR /&gt;&lt;BR /&gt;In this example I have 2 login sessions for root but they have unique IP addresses from where they logged in from.&lt;BR /&gt;&lt;BR /&gt;If you do the command "who -u | awk '{print $NF}' | tr -d ()" then you will get only the IP addresses. Match that up with the PC you are working on (what is IP of the PC you are working on?).&lt;BR /&gt;&lt;BR /&gt;So the result is &lt;BR /&gt;1.2.3.4&lt;BR /&gt;1.2.3.5&lt;BR /&gt;&lt;BR /&gt;Which IP address are you wanting, export the DISPLAY with that IP.&lt;BR /&gt;&lt;BR /&gt;Works with hostnames as well if you have name resolution</description>
      <pubDate>Thu, 13 Apr 2006 13:53:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-export-the-display-between-two-machines/m-p/3769320#M260933</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2006-04-13T13:53:51Z</dc:date>
    </item>
  </channel>
</rss>

