Bash: How to Show Escape Sequence Colors
Create the following script and run:
vi color.sh
chmod +x color.sh
./color.sh
The bash script:
#!/bin/bash
export txtrst='\x1b[00m' # Reset
echo
for i in {0..255} ; do
printf "\x1b[00;${i}m ${i}${txtrst}"
done
echo
echo
for i in {0..255} ; do
printf "\x1b[38;05;%03dm 38;05;%03d " ${i} ${i}
if [ $(( ${i} % 8 )) -eq 7 ] ; then
echo
fi
done
echo