title: How to use grep in a for loop
body: <p>Could someone please help with this script. I need to use grep  to loop to through the filenames that need to be changed.</p>
  
  <pre><code>#!/bin/bash
  
  file=
  
  for file in  $(ls $1)
  
  do
  
  grep "^.old" |  mv  "$1/$file"  "$1/$file.old"
  
  done
  </code></pre>