diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-12 10:51:53 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-12 10:51:53 +0200 |
commit | e1164626c9933261b0ed8a13b257127b62c213c9 (patch) | |
tree | 33335e68a290116e2f9c919be58f029d1809c3b4 | |
parent | 4c1cac91daa62c17825707a2fd8a4b84eda81a76 (diff) | |
download | lbsd-e1164626c9933261b0ed8a13b257127b62c213c9.tar.gz |
.shrc: Improve m
-rw-r--r-- | home/john/.shrc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/home/john/.shrc b/home/john/.shrc index 51d3be7..4196bac 100644 --- a/home/john/.shrc +++ b/home/john/.shrc @@ -15,7 +15,6 @@ case "$-" in *i*) alias ack='ack --noheading' alias info='info --vi-keys' alias ls='ls -p' - alias m='less -XF' alias vi='utf8 vi' alias w3m='utf8 w3m' alias xinput='utf8 xinput' @@ -26,6 +25,14 @@ case "$-" in *i*) rm $f } + m() { + if [ -t 1 ]; then + "$@" 2>&1 | less -XF + else + less -XF + fi + } + go() { [ -z "$1" ] && { echo usage: $0 [cmd ...] name 2>&1; return 1; } eval name=\$$# |