Formatting and more bash colors

This commit is contained in:
Lynda Wang
2020-07-26 13:58:29 -04:00
committed by Michael Campagnaro
parent 74d2cb7c42
commit 8cd9f4aa39
8 changed files with 202 additions and 175 deletions

36
aliases
View File

@@ -6,22 +6,26 @@
platform=`uname`
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
####################################################################################################
@@ -29,12 +33,12 @@ fi
####################################################################################################
error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
printf "${BOLD}${RED}$1${NORMAL}\n"
}
abort() {
error "\nAborting..."
exit 1
error "\nAborting..."
exit 1
}
reload() {