dotfiles/scripts/remcrlf
2018-09-05 09:07:37 +02:00

13 lines
170 B
Bash
Executable file

#!/usr/bin/env bash
# Removes CRLF (^M or \r) from a file
#sed -e "s/^M//" "$1" -i
tmpfile=$(mktemp)
cp "$1" "$tmpfile"
tr -d '\r' < "$tmpfile" > "$1"
rm "$tmpfile"