Created
August 10, 2013 00:29
-
-
Save karsai5/6198422 to your computer and use it in GitHub Desktop.
Removes blank lines from all html, php and css files in a directory. Sometimes when uploading multiple files to a server I find blank lines are inserted between each line of code; this script is to remove those unnecessary lines of whitespace.
This file contains 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
#! /bin/bash | |
for file in $(find . -name '*.html' -o -name '*.php' -o '*.css'); | |
do | |
sed '/^$/d' $file > tt | |
mv tt $file | |
echo "Removing empty lines from file - $file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment