title: Shell script to process files
body: <p>I need to write a Shell Script to process a huge folder of nearly 20 levels.I have to process each and every file and check which files contain lines like 
  select
  insert
  update</p>
  
  <p>When I mean line it should take the line till I find a semicolon in that file.
  I should get a result like this</p>
  
  <pre><code>C:/test.java   select * from dual
  C:/test.java   select * from test
  C:/test1.java  select * from tester
  C:/test1.java  select * from dual
  </code></pre>
  
  <p>and so on.Right now I have a script to read all the files</p>
  
  <pre><code>#!bin/ksh
  
  FILE=&lt;FILEPATH to be traversed&gt;
  TEMPFILE=&lt;Location of Temp file&gt;
  cd $FILE    
  for f in `find . ! -type d`; 
  do
  cat $FILE/addedText.txt&gt;&gt;$TEMPFILE/newFile.txt
  cat $f&gt;&gt;$TEMPFILE/newFile.txt
  rm $f
  cat $TEMPFILE/newFile.txt&gt;&gt;$f
  rm $TEMPFILE/newFile.txt
  done
  </code></pre>
  
  <p>I have very little knowledge of awk and sed to proceed further in reading each file and achieve what I want to.Can anyone help me in this</p>