Skip to content

Instantly share code, notes, and snippets.

@barbuza
Created February 6, 2010 17:57
Show Gist options
  • Save barbuza/296857 to your computer and use it in GitHub Desktop.
Save barbuza/296857 to your computer and use it in GitHub Desktop.
function remote-trailing-whitespaces {
read -n 1 -e -p 'are you sure? [y/n] ' answ
if [[ $answ == y ]]; then
echo removing trailing whitespaces from
find . -iname "$1" -type f
find . -iname "$1" -type f -print0 | xargs -0 sed -i .bak -E "s/[[:space:]]*$//"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment