Help guys!

Hello Guys,
I have written the following script to do certain job. I have more than 300 files, all are .pdb & .out files. and the files are (1,3,5,7,11,13,15,17,21,.......787,791,793,795).pdb /.out . But the way I created the for loop in my script works only one file at a time. But that is not the purpose of a for loop. So could you please help me how can I modify for loop in the following script so the script can process all the files a single run. thanks advance!

         for \(\(i=131;i<=131;i\+\+\)\); do

          awk '\{gsub\("PW " ,"TRP"\); print\}' $i.pdb > $i.amberized.pdb

          awk -f ./get.amber.parm.10.awk ./$i.modified.pdb  1.07  1.0  >  ./$i.amberized.pdb


          tstart=\`grep -an -w "Atom No." $i.out | awk '\{print $1\}' | sed "s/:/ /" | awk '\{print $1\+1\}'\`


         tstop=\`echo $tstart | awk '\{print $1\+2962\}'\`


         head -$tstop $i.out | tail -2963 > tmp

         cut -c 1-55 $i.amberized.pdb > first_half
         cut -c 65- $i.amberized.pdb > end
         cut -c 27-35 tmp > charges
         paste -d '' first_half charges | paste -d '' - end > $i.AM1.pdb

# exit

         rm tmp >& /dev/null;
         rm end >& /dev/null;

         rm charges >& /dev/null;
         rm first_half >& /dev/null;

done

You can do something like that (with bash, the extglob option must be set) :

ls -1 +([0-9]).pdb |
while read pdb_file
do
   i=${pdb_file%.pdb}

   . . . . 

done

or

for pdb_file in $(ls -1 +([0-9]).pdb
do
   i=${pdb_file%.pdb}

   . . . . 

done

thanks..it works smoothly