how to copy and rename file with for loop in bash script?
bash, linux, loops, shell
Solution
for f in *.html; do cp $f ${f%.html}.php; done
Problem
How I can copy all file *.html to *.php with For loop? help me... this my script : ``` #!/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 ``` or you have another ide ?