Skip to content

Instantly share code, notes, and snippets.

@mvasilkov
Created March 15, 2013 12:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvasilkov/5169415 to your computer and use it in GitHub Desktop.
Save mvasilkov/5169415 to your computer and use it in GitHub Desktop.
Recursively remove trailing whitespace from all files in the working directory.
#!/bin/bash
LANG=C LC_ALL=C \
find . -not \( -name .git -prune -o -name .hg -prune -o -name .svn -prune \) \
-type f -exec sed -i '' 's/[[:blank:]]*$//' '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment