<?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: Display current IP address in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042502#M303250</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;this may lead to a multiple line output, if more than one interface is configured:&lt;BR /&gt;netstat -in | awk 'NR&amp;gt;1 &amp;amp;&amp;amp; !/lo/ {print $4}'&lt;BR /&gt;&lt;BR /&gt;To get the first entry only:&lt;BR /&gt;netstat -in | awk 'NR&amp;gt;1 &amp;amp;&amp;amp; !/lo/ {print $4; exit}'&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
    <pubDate>Tue, 24 Jul 2007 06:15:51 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2007-07-24T06:15:51Z</dc:date>
    <item>
      <title>Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042501#M303249</link>
      <description>I would like to have a shell script that can display the user IP address , I think it is similiar to  "who -m | awk -F: '{ print $6}'" , this script is used to display what IP is when the user run the program . thx in advance.</description>
      <pubDate>Tue, 24 Jul 2007 06:05:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042501#M303249</guid>
      <dc:creator>ust3</dc:creator>
      <dc:date>2007-07-24T06:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042502#M303250</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;this may lead to a multiple line output, if more than one interface is configured:&lt;BR /&gt;netstat -in | awk 'NR&amp;gt;1 &amp;amp;&amp;amp; !/lo/ {print $4}'&lt;BR /&gt;&lt;BR /&gt;To get the first entry only:&lt;BR /&gt;netstat -in | awk 'NR&amp;gt;1 &amp;amp;&amp;amp; !/lo/ {print $4; exit}'&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 24 Jul 2007 06:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042502#M303250</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-07-24T06:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042503#M303251</link>
      <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;You could add the following to /etc/profile or the user's .profile:&lt;BR /&gt;&lt;BR /&gt;  export REMOTE_HOST=$(who -mu | awk '{print $8}')&lt;BR /&gt;  export REMOTE_IP=$(/usr/sbin/arp ${REMOTE_HOST} | awk '{gsub(/[()]/,"",$2)}END{print $2}')&lt;BR /&gt;&lt;BR /&gt;Then just echo ${REMOTE_IP}.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Tue, 24 Jul 2007 06:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042503#M303251</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-07-24T06:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042504#M303252</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;someting like?&lt;BR /&gt;------&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;unset IPADDRESS&lt;BR /&gt;&lt;BR /&gt;IPADDRESS=$(/usr/bin/who am i -T|awk '{print $9}')&lt;BR /&gt;export $IPADDRESS:0.0&lt;BR /&gt;------&lt;BR /&gt;Regards,&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Tue, 24 Jul 2007 07:00:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042504#M303252</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2007-07-24T07:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042505#M303253</link>
      <description>getip $(hostname)</description>
      <pubDate>Tue, 24 Jul 2007 08:40:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042505#M303253</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-07-24T08:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042506#M303254</link>
      <description>In general, it is best to use awk's $NF variable to get the last field. Counting fields (ie, $5 $6, etc) means that a change the format of preceeding data will shift the last field. Something like this:&lt;BR /&gt; &lt;BR /&gt;who -muR | awk '{print $NF}'&lt;BR /&gt;or&lt;BR /&gt;MYIP=$(who -muR | awk '{print $NF}')&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:29:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042506#M303254</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-07-24T13:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042507#M303255</link>
      <description>Hi,&lt;BR /&gt;you can use this command:&lt;BR /&gt;&lt;BR /&gt;who -mu|awk '{print $8}'&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;&lt;BR /&gt;A. Aashique</description>
      <pubDate>Wed, 25 Jul 2007 00:36:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042507#M303255</guid>
      <dc:creator>Aashique</dc:creator>
      <dc:date>2007-07-25T00:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042508#M303256</link>
      <description>sorry folks,&lt;BR /&gt;Use this command:&lt;BR /&gt;&lt;BR /&gt;who -u|awk '{print $8}'&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;&lt;BR /&gt;A. Aashique</description>
      <pubDate>Wed, 25 Jul 2007 00:37:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042508#M303256</guid>
      <dc:creator>Aashique</dc:creator>
      <dc:date>2007-07-25T00:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Display current IP address</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042509#M303257</link>
      <description>Hi ust3, you can try this:&lt;BR /&gt;&lt;BR /&gt;who -u | grep ernesto | awk '{print $8}' | sort | uniq&lt;BR /&gt;&lt;BR /&gt;where "ernesto" is the login_name.&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;ernesto</description>
      <pubDate>Wed, 25 Jul 2007 04:37:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/display-current-ip-address/m-p/4042509#M303257</guid>
      <dc:creator>Ernesto Cappello</dc:creator>
      <dc:date>2007-07-25T04:37:55Z</dc:date>
    </item>
  </channel>
</rss>

