random scripts I use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
313B

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