variable number of input files

Hi all,

I'm an extremely newbie with unix/perl. I have a perl script that I need to run on a variable number of input files (i.e., I have to run the perl script on each file, but from run to run, I have a different list of files that need to be put through this script).

I think this can be done in a shell script, but I don't even know where to begin. I can type each command over and over with the file names, but that is no different than doing it at the command line.

For example, say I have test1.dat, test2.dat, ... test20.dat.. I'd like to do something like:

for i = 1 to number of files
parse.pl test(i).dat
end

Can this be done?

Thanks for any help!
Tina :confused:

#!/bin/ksh

for i in test[0-9]*.dat
do
  parse.pl "${i}"
done

It works! Thanks so much - you just saved me hours of manual typing!

Tina