我有几个 php 文件,其中有对 .html 文件的引用。
我需要将“.html”替换为“.php”
我如何在 bash 中执行此操作?
最佳答案
for file in $(find . -name "*.php"); do
sed "s/\.html/.php/g" $file > $$ && mv $$ $file
done
关于linux - 搜索多个 php 文件,并替换文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1990409/