#!/bin/sh # Enables using colors for stdout. if test -t 1 { # Now check the _number_ of colors. setglobal NUM_COLORS = $[tput colors] if test -n $(NUM_COLORS) && test $(NUM_COLORS) -ge 8 { setglobal NORMAL = $[tput sgr0] setglobal BOLD = $[tput bold] setglobal UNDERLINE = $[tput smul] setglobal REVERSE = $[tput smso] setglobal BLINK = $[tput blink] setglobal BLACK = $[tput setaf 0] setglobal RED = $[tput setaf 1] setglobal GREEN = $[tput setaf 2] setglobal YELLOW = $[tput setaf 3] setglobal BLUE = $[tput setaf 4] setglobal MAGENTA = $[tput setaf 5] setglobal CYAN = $[tput setaf 6] setglobal WHITE = $[tput setaf 7] } }