Skip to content

Instantly share code, notes, and snippets.

@Maniacal
Created June 8, 2013 00:14
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 Maniacal/5733278 to your computer and use it in GitHub Desktop.
Save Maniacal/5733278 to your computer and use it in GitHub Desktop.
dos2unix only files that need it
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