本文介绍了在 unix 中对多个文件运行脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开始学习一些shell脚本.我有一个在一个文件上运行的 perl 脚本.我将如何编写一个 shell 脚本来在其中包含关键字文件名"的所有文件上多次运行 perl 脚本?

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?

所以在英语中,

for /filename/ in filenames
    perl myscript.pl completefilename

谢谢.

推荐答案

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

这篇关于在 unix 中对多个文件运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 17:23
查看更多