#!/bin/sh # # Display XTERM, ANSI or VT102 colours. # e=`echo | tr '012' '033'` # escape character E="$e[" # escape sequence echo "${E}m Display XTERM, ANSI or VT102 colours." echo " {ESC}[{arg};{arg}m" echo " Attributes: set=0-7 unset=20-27 (WARNING: 22 for unbold)" echo " normal=0 bold=1 underline=4 blink=5 invert=7 invisble=8" echo " Color: foreground=30-37 background=40-47" echo " black=0, red, green, yellow, blue, magenta, cyan, white=7" echo " No arguments -- return to defaults (normal)" echo "" echo "" echo \ "Fore \ Back 40 41 42 43 44 45 46 47" for fg in 30 31 32 33 34 35 36 37; do line1=" $fg " line2=" " line3=" " for bg in 40 41 42 43 44 45 46 47; do line1="${line1} ${E}${fg};${bg}m Normal ${E}0m" line2="${line2} ${E}${fg};${bg};1m Bold ${E}0m" #line3="${line3} ${E}${fg};${bg};5m Blink ${E}0m" done echo "$line1" echo "$line2" #echo "$line3" done echo "Example :-" echo " ${E}31;40m red(31) on black(40)" echo " ${E}1m bold(1) ${E}21m unbolded(21) ${E}22m unbolded(22)" echo " ${E}7m inverted(7) ${E}27m no-invert(27)" echo " ${E}4m underlined(4) ${E}24m no-underline(24)" echo " ${E}8m invisible(8) ${E}28m visible(28)" echo " ${E}43m on yellow(43) ${E}0m normal(0)" cat - <