Last Updated: February 25, 2016
·
269
· lccro

To look for files that end with a blank line

Sometimes it's important to get rid of those blank lines in the end of your scripts. Hopefully the *nix shell is very powerfull. One liner:

while read i; do (tail -1 $i | grep "^$" > /dev/null) && echo $i; done < <(find . -name \*.php)