#!/bin/bash ncolors=${1:-$(tput colors)} echo "showing $ncolors ansi colors:" for ((n = 0; n < $ncolors; n++)); do printf " [$n] $(tput setaf $n)" printf "wMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMw" printf "$(tput sgr0)\n" done