aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-05-25 21:20:27 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-05-25 21:20:27 +0300
commitfbd04400142b27a6ec27927a89ddaf8a4e09ae5b (patch)
tree86395174cf8f851dca0754f0aa78fe4897a56373
parentREADME update (diff)
downloadlinux-home-fbd04400142b27a6ec27927a89ddaf8a4e09ae5b.tar.gz
linux-home-fbd04400142b27a6ec27927a89ddaf8a4e09ae5b.zip
add line endings conversion aliases (using sed)
-rw-r--r--.bashrc2
1 files changed, 2 insertions, 0 deletions
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}'"'"