dotfiles/config/scripts/remcrlf

13 lines
170 B
Plaintext
Raw Normal View History

2017-06-14 06:06:40 +00:00
#!/usr/bin/env bash
# Removes CRLF (^M or \r) from a file
2018-09-05 07:07:37 +00:00
#sed -e "s/^M//" "$1" -i
tmpfile=$(mktemp)
cp "$1" "$tmpfile"
tr -d '\r' < "$tmpfile" > "$1"
rm "$tmpfile"