<?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 for the error logs from multiple directories in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398795#M351322</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you want the actual matching lines along with a count of the lines matched at the end, you could use:&lt;BR /&gt;&lt;BR /&gt;# cat ./filter&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;LOG=/tmp/$(basename $0).$$&lt;BR /&gt;trap 'rm ${LOG}' EXIT&lt;BR /&gt;grep failed /var/MS/YER/ROW*101/*.log &amp;gt; ${LOG}&lt;BR /&gt;cat     ${LOG}&lt;BR /&gt;wc -l &amp;lt; ${LOG}&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./filter&lt;BR /&gt;&lt;BR /&gt;By the way, please evaulate the answers you received to your previous post, too :-)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1324828" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1324828&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 09 Apr 2009 23:18:21 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-04-09T23:18:21Z</dc:date>
    <item>
      <title>script for the error logs from multiple directories</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398793#M351320</link>
      <description>I have the following directories under the dir /var/MS/YER&lt;BR /&gt;&lt;BR /&gt;ROW21_M2_HP1_20080809.163321_FTS_101/&lt;BR /&gt;ROW23_M2_HP1_20080809.164402_FTS_101/&lt;BR /&gt;ROW24_M2_HP1_20080809.165257_FTS_101/&lt;BR /&gt;ROW28_NO_HP1_20080809.171014_FTS_101/&lt;BR /&gt;ROW02_NO_HP1_20080809.171249_FTS_101/&lt;BR /&gt;ROW03_NO_HP1_20080809.172207_FTS_101/&lt;BR /&gt;ROW05_NO_HP1_20080809.173117_FTS_101/&lt;BR /&gt;ROW06_NO_HP1_20080809.173942_FTS_101/&lt;BR /&gt;ROW09_NO_HP1_20080809.174756_FTS_101/&lt;BR /&gt;ROW12_NO_HP1_20080809.175616_FTS_101/&lt;BR /&gt;ROW15_NO_HP1_20080809.180438_FTS_101/&lt;BR /&gt;&lt;BR /&gt;I have a .log file in each of the directories above..&lt;BR /&gt;&lt;BR /&gt;Is there a way or script by which I can grep for the string "failed" &amp;amp; the no. of failures(count) from all of the logs in the directories.&lt;BR /&gt;&lt;BR /&gt;plz help</description>
      <pubDate>Thu, 09 Apr 2009 21:27:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398793#M351320</guid>
      <dc:creator>Grayh</dc:creator>
      <dc:date>2009-04-09T21:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: script for the error logs from multiple directories</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398794#M351321</link>
      <description>grep failed /var/MS/YER/ROW*101/*.log | wc -l</description>
      <pubDate>Thu, 09 Apr 2009 22:05:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398794#M351321</guid>
      <dc:creator>Tingli</dc:creator>
      <dc:date>2009-04-09T22:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: script for the error logs from multiple directories</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398795#M351322</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you want the actual matching lines along with a count of the lines matched at the end, you could use:&lt;BR /&gt;&lt;BR /&gt;# cat ./filter&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;LOG=/tmp/$(basename $0).$$&lt;BR /&gt;trap 'rm ${LOG}' EXIT&lt;BR /&gt;grep failed /var/MS/YER/ROW*101/*.log &amp;gt; ${LOG}&lt;BR /&gt;cat     ${LOG}&lt;BR /&gt;wc -l &amp;lt; ${LOG}&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./filter&lt;BR /&gt;&lt;BR /&gt;By the way, please evaulate the answers you received to your previous post, too :-)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1324828" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1324828&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Apr 2009 23:18:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398795#M351322</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-09T23:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: script for the error logs from multiple directories</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398796#M351323</link>
      <description>Thanks JRF,&lt;BR /&gt;&lt;BR /&gt;I am about to run this script now... I have a small doubt...&lt;BR /&gt;&lt;BR /&gt;what does the following line do in the script&lt;BR /&gt;&lt;BR /&gt;trap 'rm ${LOG}' EXIT</description>
      <pubDate>Mon, 13 Apr 2009 11:15:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398796#M351323</guid>
      <dc:creator>Grayh</dc:creator>
      <dc:date>2009-04-13T11:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: script for the error logs from multiple directories</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398797#M351324</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; what does the following line do in the script&lt;BR /&gt;&lt;BR /&gt;trap 'rm ${LOG}' EXIT&lt;BR /&gt;&lt;BR /&gt;This simply removes the file named by ${LOG} when the script exits.  It's a convenient way to perform simple cleanup code, automatically, without explicitly calling a function or in-lining code, from any point in your script, when it exits.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 13 Apr 2009 11:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-the-error-logs-from-multiple-directories/m-p/4398797#M351324</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-13T11:20:40Z</dc:date>
    </item>
  </channel>
</rss>

