From 4b343adbcf4b3677af9da524844d269b090542e0 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Thu, 18 Dec 2014 11:32:48 -0600 Subject: [PATCH] Shellcheck fixes. --- common/.profile.d/20-functions.sh | 2 +- common/.profile.d/99-alias.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/.profile.d/20-functions.sh b/common/.profile.d/20-functions.sh index 3cc7dfe..5c81c2e 100644 --- a/common/.profile.d/20-functions.sh +++ b/common/.profile.d/20-functions.sh @@ -78,5 +78,5 @@ debug() login_shell() { - [[ $- == *i* ]] + [ "$-" = "*i*" ] } diff --git a/common/.profile.d/99-alias.sh b/common/.profile.d/99-alias.sh index 94f0e48..5fdfd12 100644 --- a/common/.profile.d/99-alias.sh +++ b/common/.profile.d/99-alias.sh @@ -7,5 +7,11 @@ alias n=noglob alias l=ls alias L='ls -dal' alias cleandir="find . -type f \( -name '*~' -o -name '#*#' -o -name '.*~' -o -name '.#*#' -o -name 'core' -o -name 'dead.letter*' \) | grep -v auto-save-list | xargs -t rm" + +# Prefer less for paging duties. which less > /dev/null 2>&1 -[ $? = 0 ] && alias T='less -f +F' || alias T='tail -f' +if [ $? -eq 0 ]; then + alias T="\$(which less) -f +F" +else + alias T="\$(which tail) -f" +fi