<?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 help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356752#M345569</link>
    <description>No need for quite so many commands, you should be able to do it in one... something like one of these should do what you need.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sed -ne 's/^running .* on \(.*\):/\1/p; s/.* \(S9[^ ]*\).*/\1/p'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk '/^running / { print $6; } / S9/ { print $9; }'</description>
    <pubDate>Wed, 11 Feb 2009 19:40:28 GMT</pubDate>
    <dc:creator>Heironimus</dc:creator>
    <dc:date>2009-02-11T19:40:28Z</dc:date>
    <item>
      <title>script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356749#M345566</link>
      <description>yea, im not a very good scripter, although I try very hard before I post for help, really.&lt;BR /&gt;&lt;BR /&gt;I have a file that looks like this:&lt;BR /&gt;running "ls -l /etc/rc2.d/" on 172.xx.xxx.xxx:  &lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;total 178&lt;BR /&gt;lrwxrwxrwx   1 root     other         20 Jul 23  2007 K00.umask.sh -&amp;gt; /etc/init.d/umask.sh&lt;BR /&gt;lrwxrwxrwx   1 root     other         26 Oct  2  2006 K02patchlinkagent -&amp;gt; /etc/init.d/patchlinkagent&lt;BR /&gt;-rwxr--r--   1 root     sys          344 Mar 20  2000 K06mipagent&lt;BR /&gt;-rwxr--r--   1 root     sys          861 Jan  5  2000 K07dmi&lt;BR /&gt;-rwxr--r--   1 root     sys          404 Jan  5  2000 K07snmpdx&lt;BR /&gt;-rwxr--r--   6 root     sys          621 Sep  1 21:53 K21dhcp&lt;BR /&gt;-rwxr--r--   1 root     sys         3080 Jan  5  2000 K28nfs.server&lt;BR /&gt;-rwxr-xr-x   1 root     other       8543 Feb 25  2003 K50Tivoli_lcf1&lt;BR /&gt;lrwxrwxrwx   1 root     other         20 Jul 23  2007 S00.umask.sh -&amp;gt; /etc/init.d/umask.sh&lt;BR /&gt;-rwxr--r--   1 root     sys         1881 Jan  5  2000 S01MOUNTFSYS&lt;BR /&gt;-rwxr--r--   1 root     sys          789 Apr 28  2004 S01VXFSLDLIC&lt;BR /&gt;-rwxr--r--   1 root     sys         2266 Dec 17  2002 S05RMTMPFILES&lt;BR /&gt;-rwxr--r--   1 root     sys          611 Jan  5  2000 S20sysetup&lt;BR /&gt;-rwxr--r--   5 root     sys         1517 Oct 28 21:49 S47asppp&lt;BR /&gt;-rwxr--r--   5 root     sys         1706 Oct 28 21:47 S47pppd&lt;BR /&gt;-r-xr-xr-x   1 root     other       5813 Jan 10  2007 S68SEOS&lt;BR /&gt;-rwxr--r--   1 root     sys        12246 Dec 13  2004 S69inet&lt;BR /&gt;-rwxr--r--   5 root     sys          420 Oct 28 21:49 S71ldap.client&lt;BR /&gt;-rwxr--r--   1 root     sys         7278 Dec 19  2004 S72inetsvc&lt;BR /&gt;-rwxr--r--   1 root     sys         1144 May 19  2004 S73cachefs.daemon&lt;BR /&gt;-rwxr--r--   1 root     sys          911 Jan  5  2000 S74syslog&lt;BR /&gt;-rwxr--r--   1 root     sys          504 Jan  5  2000 S75cron&lt;BR /&gt;lrwxrwxrwx   1 root     other         22 Jul 23  2007 S90tt_s02a111 -&amp;gt; /etc/init.d/tt_s02a111&lt;BR /&gt;-r-xr-xr-x   1 root     sys         2333 Dec  5  2002 S94vxnm-vxnetd&lt;BR /&gt;-r-xr-xr-x   1 root     sys         2309 Jun 26  2007 S95vxvm-recover&lt;BR /&gt;-r-x------   1 root     sys         2764 Dec  5  2002 S96vradmind&lt;BR /&gt;-r-x------   1 root     sys         2821 Dec  5  2002 S96vxrsyncd&lt;BR /&gt;-rwxr--r--   1 root     sys          493 Aug  7  2000 S98efcode&lt;BR /&gt;-r-xr-xr-x   1 root     other       3692 Jan 10  2007 S99SEOS&lt;BR /&gt;lrwxrwxrwx   1 root     other         18 Aug  1  2007 S99eccmad -&amp;gt; /etc/init.d/eccmad&lt;BR /&gt;-r-x--x---   1 root     other       6192 Mar  5  2005 _S68SEOS&lt;BR /&gt;-rwxr--r--   2 root     sys          715 Jan 20  2008 k16apache&lt;BR /&gt;&lt;BR /&gt;and it repeats itself over and over for every IP we have.&lt;BR /&gt;&lt;BR /&gt;how can I cut just the IP address and just the S9 programs that list under that IP?&lt;BR /&gt;I tried this but the IP's are all on top and the S9's are on the bottom.&lt;BR /&gt;&lt;BR /&gt;cat rc2* | grep running |awk -F" " '{ print $6 }' &amp;amp;&amp;amp; cat rc2* | awk -F" " '{ print $9 }' |grep S9 &amp;gt; fileout</description>
      <pubDate>Wed, 11 Feb 2009 18:16:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356749#M345566</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2009-02-11T18:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356750#M345567</link>
      <description>&lt;!--!*#--&gt;Bonsoir,&lt;BR /&gt;&lt;BR /&gt;Don't know exactly how you want to present output. Here is what I can imagine in a first approach :&lt;BR /&gt;&lt;BR /&gt;sed 's=^running "ls -l /etc/rc2.d/" on =FLAG_IP =' YourFile | sed 's=^.* S9=FLAG_S9 S9=' | grep "^FLAG_.. " | sed 's=^FLAG_IP =Found on node =' | sed 's=FLAG_S9 =- ='&lt;BR /&gt;&lt;BR /&gt;From your example, copy/pasted in the file YourFile, it gives :&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;Found on node 172.xx.xxx.xxx:&lt;BR /&gt;- S90tt_s02a111 -&amp;gt; /etc/init.d/tt_s02a111&lt;BR /&gt;- S94vxnm-vxnetd&lt;BR /&gt;- S95vxvm-recover&lt;BR /&gt;- S96vradmind&lt;BR /&gt;- S96vxrsyncd&lt;BR /&gt;- S98efcode&lt;BR /&gt;- S99SEOS&lt;BR /&gt;- S99eccmad -&amp;gt; /etc/init.d/eccmad&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;Eric&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2009 18:46:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356750#M345567</guid>
      <dc:creator>Eric SAUBIGNAC</dc:creator>
      <dc:date>2009-02-11T18:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356751#M345568</link>
      <description>A simple&lt;BR /&gt;&lt;BR /&gt;grep -e running -e S9 filename &lt;BR /&gt;&lt;BR /&gt;should be sufficient. The grep command with multiple search strings keeps its matching findings in the order that it finds them in the file.</description>
      <pubDate>Wed, 11 Feb 2009 19:34:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356751#M345568</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2009-02-11T19:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356752#M345569</link>
      <description>No need for quite so many commands, you should be able to do it in one... something like one of these should do what you need.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sed -ne 's/^running .* on \(.*\):/\1/p; s/.* \(S9[^ ]*\).*/\1/p'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk '/^running / { print $6; } / S9/ { print $9; }'</description>
      <pubDate>Wed, 11 Feb 2009 19:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/4356752#M345569</guid>
      <dc:creator>Heironimus</dc:creator>
      <dc:date>2009-02-11T19:40:28Z</dc:date>
    </item>
  </channel>
</rss>

