dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: 455cab9513fd3db99ef61c84c5f9cac52055ff83
Parent: 877ded3fa462aab528d88fc993333522fe627650
Author: Randy Palamar
Date:   Mon, 21 Jun 2021 12:31:40 -0600

use a hack to remove 3 invalid bytes in some files with windows line ends

the bytes are 0xEF 0xBB 0xBF.

this should be done with dd but I don't want to check if the bytes exist
before dd skip=3b or wtv

Diffstat:
M.config/ksh/kshrc | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/.config/ksh/kshrc b/.config/ksh/kshrc @@ -39,7 +39,6 @@ alias mkdir='mkdir -p' alias mvi='mpv --profile=image' alias ncmpcpp='tput smkx && ncmpcpp' alias page='zathura --fork' -alias tmux='tmux -2u' # managing dotfiles alias rice='git --git-dir=~/.local/repos/dotfiles --work-tree=~' @@ -84,7 +83,7 @@ IFS=' fix_line_endings() { tmpfile=$(mktemp) for file; do - sed s::: "$file" >| "$tmpfile" + sed s:::;s:^:: "$file" >| "$tmpfile" mv "$tmpfile" "$file" done } @@ -92,8 +91,7 @@ fix_line_endings() { toutf8() { tmpfile=$(mktemp) for file; do - iconv -f $(uchardet "$file") -t UTF-8 $file |\ - sed s::: >| "$tmpfile" + iconv -f $(uchardet "$file") -t UTF-8 "$file" >| "$tmpfile" mv "$tmpfile" "$file" done }