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.
find . -name "filename*" -exec perl myscript.pl '{}' \;
for i in $(\ls -d filenames)
do
perl myscript.pl $i
done
The backslash in front of the 'ls' command is to temporarily disable any aliases.
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With