#!/bin/sh # An nice and compact version of showcolor.sh that is much simpler. echo "________________________________________________________________________________" #echo "================================================================================" for (( fg=30 ; fg <= 37 ; fg++ )) do for (( attr=0 ; attr <= 1 ; attr++ )) do for (( bg=40 ; bg <= 47 ; bg++ )) do echo -ne "\033[${attr};${fg};${bg}m[${attr};${fg};${bg}m " done done echo done echo -e "\033[0m================================================================================" echo -e "\033[1mThese escape codes can be activated in a few different ways:" echo -e "a) \033[0mUsing '\\\033' within the string of 'echo -e'." echo -e "\033[1mb)\033[0m Hitting \033[1mctrl-v\033[0m then hitting the \033[1m\033[0m key, followed by ANSI escape codes." echo -e "\033[1mc)\033[0m Using '\\\e' or '\\\033' within the assignment of 'PS1' envar (*note: It's a good" echo " idea to wrap '\[' and '\]' around the whole escape sequence1)" exit 0