#!/usr/bin/env fish function crtolf -d 'Converts all CR=EOL files to LF=EOL' for f in (find . -type f) set ftype (file -b --mime-type "$f") set basetype (string split "/" "$ftype") if test "$basetype[1]" = "text" set tmp (mktemp) mac2unix -n "$f" "$tmp" mv "$tmp" "$f" end end end ## EOF