Created
December 6, 2011 18:54
-
-
Save alissonsales/1439416 to your computer and use it in GitHub Desktop.
Removing trailing spaces
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 | |
if [ -f $1 ] | |
then | |
sed "s/[[:blank:]]*$//" "$1" > "$1.tmp" | |
mv "$1.tmp" "$1" | |
else | |
echo "File $1 does not exist.\n" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if anyone fucked up your project with trailing spaces all around get rid of it with: find app/ -type f -name "*.rb" remove_trailing_spaces {} ";"