Remove the first line of multiple files and change its extension

I need to remove the first line of a certain file type from a directory, and all subdirectories. Then change each files extension to the new extension type.

Related tags: Linux

Credit: own experience

Create a new file and paste the following;

for f in `find . -iname *.cgi`
echo ${f}
sed '1d' ${f} > ${file}.php;
rm ${f};

Rating: 1

Propose a different solution...