<?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 Grep command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016605#M763083</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;is there a way to grep this string "tw008070432"&lt;BR /&gt;in the file ltdbgout32700 as below and then print out that line and 5 line a bove and 5 line below that result.&lt;BR /&gt;&lt;BR /&gt;$grep -in tw008070432 ltdbgout32700&lt;BR /&gt;189596:0x77ff1678:   44203D20 27545730 30383037 30343332   |D = 'TW008070432|&lt;BR /&gt;189601:e from DIST_G where  DIST_ID = 'TW008070432' -0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
    <pubDate>Fri, 01 Dec 2006 14:33:52 GMT</pubDate>
    <dc:creator>tom quach_1</dc:creator>
    <dc:date>2006-12-01T14:33:52Z</dc:date>
    <item>
      <title>Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016605#M763083</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;is there a way to grep this string "tw008070432"&lt;BR /&gt;in the file ltdbgout32700 as below and then print out that line and 5 line a bove and 5 line below that result.&lt;BR /&gt;&lt;BR /&gt;$grep -in tw008070432 ltdbgout32700&lt;BR /&gt;189596:0x77ff1678:   44203D20 27545730 30383037 30343332   |D = 'TW008070432|&lt;BR /&gt;189601:e from DIST_G where  DIST_ID = 'TW008070432' -0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Fri, 01 Dec 2006 14:33:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016605#M763083</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2006-12-01T14:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016606#M763084</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;I've been playing with this bit of sed code  (from "Handy One-Liners for SED" - attached) for the last few minutes, trying to get it to print more than just one line before and after:&lt;BR /&gt;&lt;BR /&gt;# print 1 line of context before and after regexp, with line number&lt;BR /&gt; # indicating where the regexp occurred (similar to "grep -A1 -B1")&lt;BR /&gt; sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h&lt;BR /&gt;&lt;BR /&gt;I've also tried playing with grep, but can't find any sort of -A1 -B1 syntax.&lt;BR /&gt;&lt;BR /&gt;Maybe you can figure something out that I'm not seeing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 01 Dec 2006 14:59:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016606#M763084</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-12-01T14:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016607#M763085</link>
      <description>How about using ex(1) for this task:&lt;BR /&gt;&lt;BR /&gt;# ex -s +'/tw008070432/-5,/tw008070432/+5 p | q!' ltdbgout32700&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Fri, 01 Dec 2006 15:06:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016607#M763085</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-01T15:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016608#M763086</link>
      <description>Hey Sandman, that's cool.  I had to take the single quotes out.&lt;BR /&gt;&lt;BR /&gt;# ex -s +/Manager/-5,/Manager/+5 p | q!'file</description>
      <pubDate>Fri, 01 Dec 2006 15:45:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016608#M763086</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-12-01T15:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016609#M763087</link>
      <description>Hi Tom:&lt;BR /&gt;&lt;BR /&gt;Your question is not infrequent.  See this thread for some solutions.  You can easily adopt mine or Hein's to process +-5 lines instead of the three in the solution presented.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=988970" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=988970&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 01 Dec 2006 16:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016609#M763087</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-01T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Grep command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016610#M763088</link>
      <description>Thank you all for your help.&lt;BR /&gt;sorry Sandman, you should get 10 points.&lt;BR /&gt;my fault, did not run the command correctly.&lt;BR /&gt;Your suggestion works good.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Tom</description>
      <pubDate>Fri, 01 Dec 2006 16:32:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command/m-p/5016610#M763088</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2006-12-01T16:32:41Z</dc:date>
    </item>
  </channel>
</rss>

