use*_*583 2 linux bash shell loops
如何使用For循环将所有文件*.html复制到*.php?
帮我...
我的脚本:
#!/bin/bash
list="$(ls *.html)"
for i in "$list"
do
newname=$(ls "$i" | sed -e 's/html/php/')
cat beginfile > "$newname"
cat "$i" | sed -e '1,26d' | tac | sed -e '1,21d' | tac >> "$newname"
cat endfiel >> "$newname"
done
Run Code Online (Sandbox Code Playgroud)
或者你有另一个想法?