Is it possible with linux commands to List all files with white spaces the after php tag at the end of file?
Answer using pcregrep which will match even if your whitespace spans onto new lines:
pcregrep -rM '\?>[\s]+[^\S]*$' *.php
Untested though because I don't have pcregrep installed on this computer. Please correct me if you know it to be incorrect.
This should match all files that end with ?>
followed by only whitespace. If it's followed by any other character, then it won't match (e.g. if it's not an all-PHP file and needs ?>
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With