dotfiles/unprocessed/config/scripts/remcrlf
Geoffrey Frogeye ee178b7d57
nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
2023-11-26 23:58:22 +01:00

15 lines
220 B
Bash
Executable file

#!/usr/bin/env bash
#! nix-shell -i bash --pure
#! nix-shell -p 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"