#!/usr/bin/env bash # Check for color support if [ -t 1 ]; then ncolors=$( tput colors ) if [ -n "${ncolors}" -a "${ncolors}" -ge 8 ]; then if normal="$( tput sgr0 )"; then # use terminfo names red="$( tput setaf 1 )" green="$( tput setaf 2)" else # use termcap names for FreeBSD compat normal="$( tput me )" red="$( tput AF 1 )" green="$( tput AF 2)" fi fi fi # Track the pid if we can find it read pid 2>/dev/null