Created
June 8, 2013 00:14
-
-
Save Maniacal/5733278 to your computer and use it in GitHub Desktop.
dos2unix only files that need it
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
IFS=: | |
while read -r name data; do | |
if [[ "$data" =~ CRLF ]]; then | |
dos2unix $name | |
fi | |
done < <(find . -type f -exec file {} \;) | |
unset IFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment