<?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 strings in files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040566#M134302</link>
    <description>a short script should work&lt;BR /&gt;&lt;BR /&gt;cat find.log | &lt;BR /&gt;while read file&lt;BR /&gt;do&lt;BR /&gt;egrep -f tables.txt $file 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? = 0 ] ;then&lt;BR /&gt;print $file&lt;BR /&gt;fi&lt;BR /&gt;done</description>
    <pubDate>Mon, 04 Aug 2003 14:00:08 GMT</pubDate>
    <dc:creator>curt larson_1</dc:creator>
    <dc:date>2003-08-04T14:00:08Z</dc:date>
    <item>
      <title>Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040565#M134301</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I listed all tables of my databse to a file called tables.txt each table in one line and I want to know if these database tables are used in some source code. These source codes are under /tmp/source/dir_1, /tmp/source/dir__2 ... /tmp/source/dir_n. I used:&lt;BR /&gt;&lt;BR /&gt;find /tmp/source -depth -print &amp;gt; find.log, to list all files under /tmp/source and it worked fine.&lt;BR /&gt;&lt;BR /&gt;then I did:&lt;BR /&gt;egrep -i -n -f tables.txt find.log, to list the files that have one of my database tables in it.&lt;BR /&gt;&lt;BR /&gt;But I do not know the table that is used because doing these commands I only know that one of the tables is present in the source code file listed but what table ? I really want to list the tables in tables.txt file that is used in one of the source code files. &lt;BR /&gt;&lt;BR /&gt;Any ideas of how can I do it ?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Mauro</description>
      <pubDate>Mon, 04 Aug 2003 13:50:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040565#M134301</guid>
      <dc:creator>Mauro_8</dc:creator>
      <dc:date>2003-08-04T13:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040566#M134302</link>
      <description>a short script should work&lt;BR /&gt;&lt;BR /&gt;cat find.log | &lt;BR /&gt;while read file&lt;BR /&gt;do&lt;BR /&gt;egrep -f tables.txt $file 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? = 0 ] ;then&lt;BR /&gt;print $file&lt;BR /&gt;fi&lt;BR /&gt;done</description>
      <pubDate>Mon, 04 Aug 2003 14:00:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040566#M134302</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-08-04T14:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040567#M134303</link>
      <description>find /ias -exec grep -l '/oracle/ias/product' {} \;&lt;BR /&gt;&lt;BR /&gt;Change as needed.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 04 Aug 2003 14:03:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040567#M134303</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-08-04T14:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040568#M134304</link>
      <description>guess i should read your requirements better&lt;BR /&gt;&amp;gt; I really want to list the tables in tables.txt file that is used &lt;BR /&gt;&lt;BR /&gt;how about this:&lt;BR /&gt;&lt;BR /&gt;cat find.log | &lt;BR /&gt;while read file &lt;BR /&gt;do &lt;BR /&gt;egrep -f tables.txt $file 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &lt;BR /&gt;if [ $? = 0 ] ;then &lt;BR /&gt;print "\nTables in $file:\n" &lt;BR /&gt;egrep -f tables.txt $file &lt;BR /&gt;fi &lt;BR /&gt;done</description>
      <pubDate>Mon, 04 Aug 2003 14:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040568#M134304</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-08-04T14:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040569#M134305</link>
      <description>Mauro,&lt;BR /&gt;&lt;BR /&gt;1. You can simply go to each dir_1, dir_2 etc., i.e. cd /tmp/source/dir_1 and run a command:&lt;BR /&gt;&lt;BR /&gt;egrep -f tables.txt *&lt;BR /&gt;&lt;BR /&gt;2. find /tmp/source -depth -print -exec egrep -f tables.txt {} \; |more , but this will also list all the files under /tmp/source. &lt;BR /&gt;&lt;BR /&gt;Elena.</description>
      <pubDate>Mon, 04 Aug 2003 15:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040569#M134305</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2003-08-04T15:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find strings in files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040570#M134306</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Another way to find...&lt;BR /&gt;&lt;BR /&gt;cd /tmp/source&lt;BR /&gt;for table in `cat tables.txt`&lt;BR /&gt;do&lt;BR /&gt;find . -type f | xargs grep $table&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;you have to give absolute path of tables.txt&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;VJ.</description>
      <pubDate>Tue, 05 Aug 2003 10:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-strings-in-files/m-p/3040570#M134306</guid>
      <dc:creator>vasundhara</dc:creator>
      <dc:date>2003-08-05T10:20:53Z</dc:date>
    </item>
  </channel>
</rss>

