<?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: awk command question:  equivalent to grep.? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007480#M298312</link>
    <description>Thanks Dennis,  Works fine with gawk ( GNU Awk 3.0 ) :&lt;BR /&gt;&lt;BR /&gt;hpap091# swlist -l product | gawk -v IGNORECASE=1 '/serviceguard|PHSS_34504/ { print $0}'&lt;BR /&gt;  PHSS_34504            1.0            Serviceguard A.11.16.00&lt;BR /&gt;  SG-Apache-Tool        B.02.21        Serviceguard Apache Script Templates&lt;BR /&gt;  SG-NFS-Tool           A.11.23.03     Serviceguard NFS Script Templates&lt;BR /&gt;  SG-Oracle-Tool        B.02.21        Serviceguard Oracle Script Templates&lt;BR /&gt;  SG-Samba-Tool         B.02.21        Serviceguard Samba Script Templates&lt;BR /&gt;  SG-Tomcat-Tool        B.02.21        Serviceguard Tomcat Script Templates&lt;BR /&gt;  ServiceGuard          A.11.16.00     ServiceGuard&lt;BR /&gt;hpap091#&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing out that, and it works fine.</description>
    <pubDate>Tue, 29 May 2007 14:56:49 GMT</pubDate>
    <dc:creator>rveri</dc:creator>
    <dc:date>2007-05-29T14:56:49Z</dc:date>
    <item>
      <title>awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007474#M298306</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;What is the awk command that is equivalent to "grep -i -e "&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;# swlist -l product | grep -i -e "serviceguard" -e "PHSS_34504"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2007 15:43:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007474#M298306</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2007-05-25T15:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007475#M298307</link>
      <description>try the one below...&lt;BR /&gt;&lt;BR /&gt;# swlist -l product | awk '$1=="ServiceGuard" || $1=="PHSS_34504"'</description>
      <pubDate>Fri, 25 May 2007 15:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007475#M298307</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-25T15:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007476#M298308</link>
      <description>Why would you want to use the wrong tool?&lt;BR /&gt;&lt;BR /&gt;The only thing I see in awk is that you can use tolower and then do the compare or regular expression match.  To search for multiple patterns (-e), you would have to use ||.</description>
      <pubDate>Fri, 25 May 2007 15:52:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007476#M298308</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-25T15:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007477#M298309</link>
      <description>swlist -l product | awk -v IGNORECASE=1 '/serviceguard|PHSS_34504/ { print $0}'&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2007 17:08:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007477#M298309</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-05-25T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007478#M298310</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;Sandman: command working, you already using the correct string. :)&lt;BR /&gt;&lt;BR /&gt;Ivan, &lt;BR /&gt;Looks like in your command IGNORECASE not working: Any way I got the idea.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# swlist -l product | awk -v IGNORECASE=1 '/serviceguard|PHSS_34504/ { print $0}'&lt;BR /&gt;  PHSS_34504            1.0            Serviceguard A.11.16.00&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# swlist -l product | awk -v IGNORECASE=1 '/ServiceGuard|PHSS_34504/ { print $0}'&lt;BR /&gt;  PHSS_34504            1.0            Serviceguard A.11.16.00&lt;BR /&gt;  ServiceGuard          A.11.16.00     ServiceGuard&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Fri, 25 May 2007 22:24:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007478#M298310</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2007-05-25T22:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007479#M298311</link>
      <description>&amp;gt;Ivan: awk -v IGNORECASE=1 '/serviceguard|PHSS_34504/ { print $0}'&lt;BR /&gt;&lt;BR /&gt;HP's awk doesn't support IGNORECASE.  But gawk seems to.</description>
      <pubDate>Tue, 29 May 2007 14:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007479#M298311</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-29T14:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007480#M298312</link>
      <description>Thanks Dennis,  Works fine with gawk ( GNU Awk 3.0 ) :&lt;BR /&gt;&lt;BR /&gt;hpap091# swlist -l product | gawk -v IGNORECASE=1 '/serviceguard|PHSS_34504/ { print $0}'&lt;BR /&gt;  PHSS_34504            1.0            Serviceguard A.11.16.00&lt;BR /&gt;  SG-Apache-Tool        B.02.21        Serviceguard Apache Script Templates&lt;BR /&gt;  SG-NFS-Tool           A.11.23.03     Serviceguard NFS Script Templates&lt;BR /&gt;  SG-Oracle-Tool        B.02.21        Serviceguard Oracle Script Templates&lt;BR /&gt;  SG-Samba-Tool         B.02.21        Serviceguard Samba Script Templates&lt;BR /&gt;  SG-Tomcat-Tool        B.02.21        Serviceguard Tomcat Script Templates&lt;BR /&gt;  ServiceGuard          A.11.16.00     ServiceGuard&lt;BR /&gt;hpap091#&lt;BR /&gt;&lt;BR /&gt;Thanks for pointing out that, and it works fine.</description>
      <pubDate>Tue, 29 May 2007 14:56:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007480#M298312</guid>
      <dc:creator>rveri</dc:creator>
      <dc:date>2007-05-29T14:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007481#M298313</link>
      <description>imho since you know both product names you don't need to grep or awk for either of them. Instead the command below will suffice for both.&lt;BR /&gt;&lt;BR /&gt;# swlist -l product ServiceGuard -l product PHSS_34504</description>
      <pubDate>Tue, 29 May 2007 15:20:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007481#M298313</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-29T15:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007482#M298314</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;If you are still looking the awk option, here it is:&lt;BR /&gt;&lt;BR /&gt;# swlist -l product | awk ' { tolower($1) } /DigitalVideo|PHKL_8377/'&lt;BR /&gt;  DigitalVideo          B.10.20        Digital Video Software &lt;BR /&gt;  PHKL_8377             B.10.00.00.AA  vmtrace and malloc() patch &lt;BR /&gt;&lt;BR /&gt;The above is from an old machine, I have. For your case it is like:&lt;BR /&gt;&lt;BR /&gt;swlist -l product | awk ' { tolower($1) } /ServiceGuard|PHSS_9397/' &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rasheed Tamton.</description>
      <pubDate>Wed, 30 May 2007 02:09:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007482#M298314</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-05-30T02:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007483#M298315</link>
      <description># swlist -l product | awk '{ tolower($1) } /DigitalVideo|PHKL_8377/'&lt;BR /&gt;&lt;BR /&gt;This doesn't really work.  The result of tolower isn't used.  The regular expression you have, matches without any need to downshift.</description>
      <pubDate>Wed, 30 May 2007 02:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007483#M298315</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-30T02:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007484#M298316</link>
      <description>&lt;!--!*#--&gt;Alright, if you want to use use toupper, you can use:&lt;BR /&gt;$ swlist -l product | awk 'toupper($1) ~ /MAKE|GETTEXT/'&lt;BR /&gt;This returns:&lt;BR /&gt;  automake  1.9.6   automake&lt;BR /&gt;  make      3.80    make&lt;BR /&gt;  Gettext   0.10.39.4  GNU gettext NLS library&lt;BR /&gt;  gettext   0.12    gettext&lt;BR /&gt;&lt;BR /&gt;(Your patterns must be the case of your "to*" function.)&lt;BR /&gt;</description>
      <pubDate>Wed, 30 May 2007 02:27:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007484#M298316</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-30T02:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: awk command question:  equivalent to grep.?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007485#M298317</link>
      <description>swlist -l product|awk ' {if(tolower($1) ~ /(digital|x11|openssh)/) print } '&lt;BR /&gt;  DigitalVideo          B.10.20        Digital Video Software &lt;BR /&gt;  X11                   B.10.20        HP-UX X Window Software &lt;BR /&gt;  X11BMS                B.10.20        HP-UX BMS for X Window Software &lt;BR /&gt;  openssh               4.3p2          openssh        &lt;BR /&gt;&lt;BR /&gt;The only thing to take care is that the regex should be in lower case.&lt;BR /&gt;&lt;BR /&gt;So, in this case need to use /(serviceguard|phss_9397)/&lt;BR /&gt;both search strings should be in lower case becuase it is already converted to lower case.&lt;BR /&gt;</description>
      <pubDate>Wed, 30 May 2007 04:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-command-question-equivalent-to-grep/m-p/4007485#M298317</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-05-30T04:15:17Z</dc:date>
    </item>
  </channel>
</rss>

