<?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 file based on list in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208932#M678577</link>
    <description>I just realized there is a simpler solution than my awk script above.  The key thing is to use vector methods and not loops.&lt;BR /&gt;find /tool -name "*.prt" | fgrep -f name.txt | xargs ll</description>
    <pubDate>Sat, 14 Nov 2009 00:24:24 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-11-14T00:24:24Z</dc:date>
    <item>
      <title>Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208926#M678571</link>
      <description>I have a file that contains a partial file name.&lt;BR /&gt;Example name.txt contains&lt;BR /&gt;573_-_mm-cubeside180&lt;BR /&gt;573_-_mm-cubeside270&lt;BR /&gt;573_-_mm-cubeside90&lt;BR /&gt;573_-_mm-datum-ring&lt;BR /&gt;573_-_mm-datumringstand&lt;BR /&gt;&lt;BR /&gt;I want to use 'find' to located them on disk with adding file extention.&lt;BR /&gt;example: find /tool -name 573_-_mm-cubeside180*.prt &lt;BR /&gt;And use the output from 'find' to exec ls -l on the full path of the file.</description>
      <pubDate>Wed, 11 Nov 2009 22:09:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208926#M678571</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2009-11-11T22:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208927#M678572</link>
      <description>Hi Mike:&lt;BR /&gt;&lt;BR /&gt;Give your file named 'name.txt' with each line representing a filename, you could do:&lt;BR /&gt;&lt;BR /&gt;while read NAME&lt;BR /&gt;do&lt;BR /&gt;    find /tool -xdev -type f -name "${NAME}*.prt" -exec ls -l {} +&lt;BR /&gt;done &amp;lt; name.txt&lt;BR /&gt;&lt;BR /&gt;I use the -xdev' so as not to cross mountpoints.  I use the '-type f' to restrict us to files and not directories, etc.  The use of the "+' terminator means that multiple arguments (here, filenames) can be collected and passed to one instantation of the command ('ls').  This is quite efficient.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2009 22:19:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208927#M678572</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-11T22:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208928#M678573</link>
      <description>HI,&lt;BR /&gt;You can used find command with for loop&lt;BR /&gt;i.e.&lt;BR /&gt;for i in `cat name.txt`&lt;BR /&gt;do&lt;BR /&gt;find . -name $i -exec ls -l {} \; &amp;gt;/tmp/find.out&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Wed, 11 Nov 2009 22:19:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208928#M678573</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-11-11T22:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208929#M678574</link>
      <description>If you have lots of files or a very large filesystem to search, you don't want to use a stinkin' for loop with find(1).&lt;BR /&gt;&lt;BR /&gt;Possibly something like:&lt;BR /&gt;find /tool $(&lt;BR /&gt;awk  '&lt;BR /&gt;BEGIN { print "(" }&lt;BR /&gt;{&lt;BR /&gt;print "-name " $1 "*.prt -o "&lt;BR /&gt;}&lt;BR /&gt;END { print " -name bad_Xname )" } ' &amp;lt; name.txt&lt;BR /&gt;) -exec ll +</description>
      <pubDate>Thu, 12 Nov 2009 13:27:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208929#M678574</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-12T13:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208930#M678575</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;@ Dennis:  That's a very nice solution to keep from abusing the server! :-)&lt;BR /&gt;&lt;BR /&gt;@ Mike: No points for this comment, please.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Nov 2009 13:59:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208930#M678575</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-12T13:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208931#M678576</link>
      <description>Thanks for all the assistance.</description>
      <pubDate>Thu, 12 Nov 2009 14:04:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208931#M678576</guid>
      <dc:creator>Michael Allmer</dc:creator>
      <dc:date>2009-11-12T14:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find file based on list</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208932#M678577</link>
      <description>I just realized there is a simpler solution than my awk script above.  The key thing is to use vector methods and not loops.&lt;BR /&gt;find /tool -name "*.prt" | fgrep -f name.txt | xargs ll</description>
      <pubDate>Sat, 14 Nov 2009 00:24:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-file-based-on-list/m-p/5208932#M678577</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-14T00:24:24Z</dc:date>
    </item>
  </channel>
</rss>

