Created
March 3, 2017 20:59
-
-
Save foxumon/b2ec9a0d1f4422ee77ca89a7d5fb3c70 to your computer and use it in GitHub Desktop.
Delete PHP files with errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ... -iname "*.php" -exec php -l {} \; | grep -i "Errors.parsing" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ... -exec bash -c ' | |
if php -l "$1" >&/dev/null; then | |
echo "$1: pass" >&/dev/null; | |
else | |
sudo rm $1 | |
echo "$1: fail" | |
fi' -- {} \; | tail -n +1 | head -50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment