<?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: find command causes dump? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109480#M445720</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;first check, if 'grep' really results in what all expect:&lt;BR /&gt;type grep&lt;BR /&gt;This should be /usr/bin/grep .&lt;BR /&gt;&lt;BR /&gt;Two more thoughts:&lt;BR /&gt;1) Feed only plain files to grep - your find command lists even dirs, FIFOs, ...&lt;BR /&gt;find . -type f -name '*.log' |xargs grep err&lt;BR /&gt;&lt;BR /&gt;2) grep won't tell the filename, when only one argument is supplied. This may happen, when there is only one file found or just one left for the last call of xargs. I suggest to provide /dev/null for this:&lt;BR /&gt;find . -type f -name '*.log' |xargs grep err&lt;BR /&gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
    <pubDate>Tue, 20 May 2008 13:32:53 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2008-05-20T13:32:53Z</dc:date>
    <item>
      <title>find command causes dump?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109477#M445717</link>
      <description>I tried the following command to find log files with the text 'ERR' in them:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;find . -name '*.log' |xargs grep ERR&lt;BR /&gt;&lt;BR /&gt;This works fine. But when i look for files containing 'err', this happens:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;find . -name '*.log' |xargs grep err&lt;BR /&gt;find: cannot open ./.Thatfile&lt;BR /&gt;THE APPLICATION PROGRAM DUMP DUMP SUCCESSFULLY CREATED!&lt;BR /&gt;THE APPLICATION PROGRAM DUMP DUMP SUCCESSFULLY CREATED!&lt;BR /&gt;&lt;BR /&gt;and so on&lt;BR /&gt;&lt;BR /&gt;Apparently, the last command should have been &lt;BR /&gt;&amp;gt;find . -name '*.log' |xargs grep 'err'&lt;BR /&gt;instead&lt;BR /&gt;&lt;BR /&gt;Any idea what happened here?</description>
      <pubDate>Mon, 19 May 2008 13:09:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109477#M445717</guid>
      <dc:creator>Dag A.</dc:creator>
      <dc:date>2008-05-19T13:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: find command causes dump?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109478#M445718</link>
      <description>You shouldn't have to quote "err" in the grep.&lt;BR /&gt;If you can't figure out how to use xargs, give up and pass xargs a simple script:&lt;BR /&gt;$ find . -name '*.log' | xargs grep_err&lt;BR /&gt;&lt;BR /&gt;Then create a script called grep_err:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;grep err $@</description>
      <pubDate>Tue, 20 May 2008 09:23:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109478#M445718</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-05-20T09:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: find command causes dump?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109479#M445719</link>
      <description>I agree with Dennis. No need to quote err with the grep.&lt;BR /&gt;&lt;BR /&gt;May be your OS version is bit old or not patched well.&lt;BR /&gt;&lt;BR /&gt;You can also try&lt;BR /&gt;find . -name '*log' -exec grep err {} \;      &lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;find . -name '*list*' -exec grep err {} +</description>
      <pubDate>Tue, 20 May 2008 10:59:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109479#M445719</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2008-05-20T10:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: find command causes dump?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109480#M445720</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;first check, if 'grep' really results in what all expect:&lt;BR /&gt;type grep&lt;BR /&gt;This should be /usr/bin/grep .&lt;BR /&gt;&lt;BR /&gt;Two more thoughts:&lt;BR /&gt;1) Feed only plain files to grep - your find command lists even dirs, FIFOs, ...&lt;BR /&gt;find . -type f -name '*.log' |xargs grep err&lt;BR /&gt;&lt;BR /&gt;2) grep won't tell the filename, when only one argument is supplied. This may happen, when there is only one file found or just one left for the last call of xargs. I suggest to provide /dev/null for this:&lt;BR /&gt;find . -type f -name '*.log' |xargs grep err&lt;BR /&gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 20 May 2008 13:32:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109480#M445720</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2008-05-20T13:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: find command causes dump?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109481#M445721</link>
      <description>Closing thread.&lt;BR /&gt;&lt;BR /&gt;By the way, the OS is old (ver 10.20)</description>
      <pubDate>Wed, 14 Apr 2010 13:46:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-causes-dump/m-p/5109481#M445721</guid>
      <dc:creator>Dag A.</dc:creator>
      <dc:date>2010-04-14T13:46:12Z</dc:date>
    </item>
  </channel>
</rss>

