<?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: grep command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301111#M711713</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;# grep '$ADRESSIP' file&lt;BR /&gt;&lt;BR /&gt;Robert-Jan</description>
    <pubDate>Thu, 10 Jun 2004 02:55:47 GMT</pubDate>
    <dc:creator>Robert-Jan Goossens</dc:creator>
    <dc:date>2004-06-10T02:55:47Z</dc:date>
    <item>
      <title>grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301110#M711712</link>
      <description>Hello,&lt;BR /&gt;here my file: 156.152.45.5&lt;BR /&gt;              156.152.45.58&lt;BR /&gt;              156.152.45.589&lt;BR /&gt;and variable $ADRESSIP=156.152.45.5&lt;BR /&gt;i want to do a "grep" $ADRESSIP on my file&lt;BR /&gt;with only $ADRESSIP in the output and not&lt;BR /&gt;other word (not 156.152.45.58,156.152.45.589)&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 02:49:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301110#M711712</guid>
      <dc:creator>iranzo</dc:creator>
      <dc:date>2004-06-10T02:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301111#M711713</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;# grep '$ADRESSIP' file&lt;BR /&gt;&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Thu, 10 Jun 2004 02:55:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301111#M711713</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-06-10T02:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301112#M711714</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can do:&lt;BR /&gt;&lt;BR /&gt;grep -w '$ADRESSIP' file&lt;BR /&gt;&lt;BR /&gt;manish.</description>
      <pubDate>Thu, 10 Jun 2004 03:01:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301112#M711714</guid>
      <dc:creator>Manish Srivastava</dc:creator>
      <dc:date>2004-06-10T03:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301113#M711715</link>
      <description>Try&lt;BR /&gt;&lt;BR /&gt;grep "$ADRESSIP$" file&lt;BR /&gt;&lt;BR /&gt;Note the $ at the end of the ADDRESSIP.  This means that you will get any line that contains your IP address, followed by an end of line marker.  This should exclude the other addresses from your search.&lt;BR /&gt;&lt;BR /&gt;If that doesn't work, it may be that you have a space or tab character following the IP address.  In this case, use&lt;BR /&gt;&lt;BR /&gt;grep "$ADRESSIP " file &lt;BR /&gt;or&lt;BR /&gt;grep "$ADRESSIP&lt;TAB&gt;" file&lt;BR /&gt;&lt;BR /&gt;(use the TAB key rather than typing &lt;TAB&gt;&lt;/TAB&gt;&lt;/TAB&gt;</description>
      <pubDate>Thu, 10 Jun 2004 03:13:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301113#M711715</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2004-06-10T03:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301114#M711716</link>
      <description>Did you try:&lt;BR /&gt;grep -x $ADRESSIP file?&lt;BR /&gt;Using -x (eXact) Matches are recognized only when the entire input line matches the fixed string or regular expression.&lt;BR /&gt;&lt;BR /&gt;RGDS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Mauro</description>
      <pubDate>Thu, 10 Jun 2004 03:16:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301114#M711716</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2004-06-10T03:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301115#M711717</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It works for me:&lt;BR /&gt;&lt;BR /&gt;$cat file&lt;BR /&gt;debug&lt;BR /&gt;debug1&lt;BR /&gt;$DF=debug&lt;BR /&gt;$grep -w $DF file&lt;BR /&gt;debug&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As you can see debug1 is not displayed. It displays only the word which we are looking for.&lt;BR /&gt;&lt;BR /&gt;manish&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 03:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301115#M711717</guid>
      <dc:creator>Manish Srivastava</dc:creator>
      <dc:date>2004-06-10T03:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301116#M711718</link>
      <description>on my HPUX B.11.00&lt;BR /&gt;"grep -x and grep -w" not working !&lt;BR /&gt;Problem with patches ?&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 03:36:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301116#M711718</guid>
      <dc:creator>iranzo</dc:creator>
      <dc:date>2004-06-10T03:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301117#M711719</link>
      <description>Check with egrep&lt;BR /&gt;&lt;BR /&gt;$egrep -w $ADRESSIP file_name&lt;BR /&gt;$egrep -x $ADRESSIP file_name&lt;BR /&gt;&lt;BR /&gt;sks&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 03:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301117#M711719</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-06-10T03:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301118#M711720</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you don't hate awk   8))):&lt;BR /&gt;&lt;BR /&gt;awk `$1==A {print }' A=$ADDRESSIP $FILE&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 10 Jun 2004 04:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301118#M711720</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-06-10T04:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301119#M711721</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you only need $ADRESSIP in the output, you can do a grep and if grep is successful then print the ip, for example:&lt;BR /&gt;&lt;BR /&gt;ADRESSIP=156.152.45.5&lt;BR /&gt;grep $ADRESSIP file &amp;amp;&amp;amp; echo $ADRESSIP&lt;BR /&gt;&lt;BR /&gt;if no $ADRESSIP in file the command line output nothing, if $ADRESSIP in file the command line outputs the $ADRESSIP only&lt;BR /&gt;&lt;BR /&gt;Frank.</description>
      <pubDate>Thu, 10 Jun 2004 06:23:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301119#M711721</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-06-10T06:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301120#M711722</link>
      <description>Hi again, &lt;BR /&gt;&lt;BR /&gt;I made a mistake in the command, the correct one is:&lt;BR /&gt;&lt;BR /&gt;grep $ADRESSIP file &amp;gt; /dev/null &amp;amp;&amp;amp; echo $ADRESSIP.&lt;BR /&gt;&lt;BR /&gt;Sorry&lt;BR /&gt;Frank.</description>
      <pubDate>Thu, 10 Jun 2004 06:25:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301120#M711722</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-06-10T06:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301121#M711723</link>
      <description>Frank,&lt;BR /&gt;What about this one:&lt;BR /&gt;&lt;BR /&gt;# cat &amp;gt; xyz&lt;BR /&gt;one&lt;BR /&gt;two three&lt;BR /&gt;four&lt;BR /&gt;five&lt;BR /&gt;#&lt;BR /&gt;# VAR=one&lt;BR /&gt;# cat xyz | grep "$VAR"&lt;BR /&gt;one&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;Remember i am using default POSIX shell of HPUX.&lt;BR /&gt;This should work with KSH also.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 06:33:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301121#M711723</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-06-10T06:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301122#M711724</link>
      <description>IN RESPONSE TO YOUR: on my HPUX B.11.00 "grep -x and grep -w" not working ! Problem with patches ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;YES, you need to PATCH your system, as "grep -w" and "grep -x" should exist and work.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 10 Jun 2004 06:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301122#M711724</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2004-06-10T06:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301123#M711725</link>
      <description>Sorry,&lt;BR /&gt;Earlier one is having bug in that. Try this one. it is bit lengthy, hope you don't mind.&lt;BR /&gt;&lt;BR /&gt;create one script called "myscr" and you have file called "xyz" then:&lt;BR /&gt;# cat myscript&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;list=`cat xyz`&lt;BR /&gt;myfunct()&lt;BR /&gt;{&lt;BR /&gt;VAR11=$#&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;if [ VAR11 -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo $1&lt;BR /&gt;shift&lt;BR /&gt;let VAR11=$VAR11-1&lt;BR /&gt;else&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;myfunct $list&lt;BR /&gt;&lt;BR /&gt;----- end of script ----------&lt;BR /&gt;&lt;BR /&gt;#chmod +x myscript&lt;BR /&gt;#./myscript | grep "$VAR"&lt;BR /&gt;&lt;BR /&gt;I have tested this one and works fine.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2004 06:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301123#M711725</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-06-10T06:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301124#M711726</link>
      <description>Now look at this one, more user friendly.&lt;BR /&gt;Again don't mind the lenght, it's once for all.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;echo " Enter values to be searched in file : "&lt;BR /&gt;read VAR1&lt;BR /&gt;echo "\n Enter file name in which the above value to be searched :  "&lt;BR /&gt;read VAR2&lt;BR /&gt;list=`cat $VAR2`&lt;BR /&gt;myfunct()&lt;BR /&gt;{&lt;BR /&gt;VAR11=$#&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;if [ VAR11 -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo $1&lt;BR /&gt;shift&lt;BR /&gt;let VAR11=$VAR11-1&lt;BR /&gt;else&lt;BR /&gt;exit&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;myfunct $list | grep "$VAR1"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if that helped.&lt;BR /&gt;Regards,</description>
      <pubDate>Thu, 10 Jun 2004 06:57:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301124#M711726</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-06-10T06:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301125#M711727</link>
      <description>Hey,&lt;BR /&gt;&lt;BR /&gt;I get this problem when I use -w. Can u download a gnu version of grep and try grep -w ?.&lt;BR /&gt;&lt;BR /&gt;Regds,&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Thu, 10 Jun 2004 07:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301125#M711727</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-06-10T07:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301126#M711728</link>
      <description>I think HP-UX grep don't have the -w option. Someone mentioned about a patch ??&lt;BR /&gt;&lt;BR /&gt;We resolved this be downloading the gnu grep (ggrep) from &lt;A href="http://www.gnu.org." target="_blank"&gt;www.gnu.org.&lt;/A&gt; ggrep has much more than -w to offer in my opinion.</description>
      <pubDate>Thu, 10 Jun 2004 07:12:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301126#M711728</guid>
      <dc:creator>Abdul Rahiman</dc:creator>
      <dc:date>2004-06-10T07:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301127#M711729</link>
      <description>Does this work&lt;BR /&gt; &lt;BR /&gt;perl  -ne '/\b156.152.45.5\b/ &amp;amp;&amp;amp; print' datafile</description>
      <pubDate>Thu, 10 Jun 2004 07:15:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301127#M711729</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-10T07:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301128#M711730</link>
      <description>Or, if you want it to take the variable&lt;BR /&gt; &lt;BR /&gt;export ADRESSIP="156.152.45.5"&lt;BR /&gt;perl  -ne '/\b$ENV{ADRESSIP}\b/ &amp;amp;&amp;amp; print'</description>
      <pubDate>Thu, 10 Jun 2004 07:20:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301128#M711730</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-10T07:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301129#M711731</link>
      <description>i can confirm "-w" doesn't work in AIX as well&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Thu, 10 Jun 2004 07:31:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/3301129#M711731</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-06-10T07:31:31Z</dc:date>
    </item>
  </channel>
</rss>

