From a64c3653d5df5e823fcdd07a540e240283816683 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 12 Aug 2021 18:15:16 -0400 Subject: Add cat alias using less Idea is that LESS=FRX makes it the same for short files... But less on OpenBSD behaves weirdly. I'll see. --- home/.shrc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'home') diff --git a/home/.shrc b/home/.shrc index 4b0e6c61..605f864e 100644 --- a/home/.shrc +++ b/home/.shrc @@ -18,6 +18,14 @@ alias rand='openssl rand -base64 33' alias private='eval "$(gpg -d ~/.private)"' type doas >/dev/null && alias sudo=doas +cat() { + if [ $# -eq 1 ] && test -t 1; then + less "$@" + else + command cat "$@" + fi +} + man() { test $# -ne 1 && { command man "$@"; return $?; } (IFS=: -- cgit 1.4.1