Blame view

tools/coltest 341 Bytes
Georg Hopp authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/sh

function coltest() {
	local ECHO="/bin/echo"

	if [ $# -lt 1 ]
	then
		${ECHO} "coltest 256fg-col [256bg-col]"
		return
	fi

	${ECHO} -en "\033[38;5;${1}m"
	[ "$2" ] && ${ECHO} -en "\033[48;5;${2}m"
	${ECHO} -n "test"
	${ECHO} -e "\033[00m"
}

test "X$(basename -- "$0")" = "Xcoltest" && coltest "$@"

# vim: set ft=sh ts=4 sw=4: