Skip to content

Instantly share code, notes, and snippets.

@jakub-g
Last active December 29, 2015 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakub-g/7599651 to your computer and use it in GitHub Desktop.
Save jakub-g/7599651 to your computer and use it in GitHub Desktop.
Normalize trailing newlines
find . -type f \( -name "*.htm*" -or -name "*.js*" -or -name "*.css" -or -name "*.*ml" -or -name "*.tpl" -or -name "*.md" -or -name "*.txt" \) -exec sh -c 'echo -e "\r\n" >> "$0" ' {} \; -exec sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment