2017-06-14 08:06:40 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-11-26 21:04:58 +01:00
|
|
|
#! nix-shell -i bash --pure
|
|
|
|
#! nix-shell -p bash
|
2017-06-14 08:06:40 +02:00
|
|
|
|
|
|
|
# Removes CRLF (^M or \r) from a file
|
|
|
|
|
2018-09-05 09:07:37 +02:00
|
|
|
#sed -e "s/^M//" "$1" -i
|
|
|
|
|
|
|
|
tmpfile=$(mktemp)
|
|
|
|
|
|
|
|
cp "$1" "$tmpfile"
|
|
|
|
tr -d '\r' < "$tmpfile" > "$1"
|
|
|
|
rm "$tmpfile"
|
|
|
|
|