nicoorfi
10/30/2019 - 12:17 PM

Run command on files with extension

Echo in file

find . -name *.php |while read var; do echo “testing” >> $var; done

Add strict types to all php files in folder

find ./custom/plugins -type f -name "*.php" |while read var; do sed -i '' '1G;' $var && sed -i '' '1G;' $var && sed -i '' '1G;' $var  && sed -i '' "3i\\
declare(strict_types=1);" $var ; done