Dirk Dirk - 3 months ago 15
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


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