From fbd04400142b27a6ec27927a89ddaf8a4e09ae5b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 25 May 2016 21:20:27 +0300 Subject: add line endings conversion aliases (using sed) --- .bashrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bashrc b/.bashrc index c757f38..1f80cd9 100644 --- a/.bashrc +++ b/.bashrc @@ -247,6 +247,8 @@ adjust_dotfiles_permissions() { && popd > /dev/null } +alias dos2unix_='sed --binary --in-place '"'"'s/\(\r\?\)$//'"'" +alias unix2dos_='sed --binary --in-place '"'"'s/\r\?$/\r/'"'" alias rtrim_line_whitespace='sed --binary --in-place '"'"'s/[[:blank:]]*\(\r\?\)$/\1/'"'" alias rtrim_file_newlines_dos='sed --binary --in-place -e :a -e '"'"'/^\(\r\n\)*\r$/{$d;N;ba}'"'" alias rtrim_file_newlines_unix='sed --binary --in-place -e :a -e '"'"'/^\n*$/{$d;N;ba}'"'" -- cgit v1.2.3