Dirk Dirk - 1 month ago 7
Bash Question

Run a script over multiple files in unix

Started to learn some shell scripting. I have a perl script that runs on one file. How would I write a shell script to run the perl script a bunch of times on all files with keyword "filename" in it?

So in English,

for /filename/ in filenames
perl myscript.pl completefilename


Thanks.

Answer Source
find . -name "filename*" -exec perl myscript.pl '{}' \;