Ticket #1469: color_codes

File color_codes, 1.1 KB (added by bonefish, 17 years ago)

mmu_man's script to print a table showing the effect of the color codes

Line 
1#!/bin/sh
2echo -e
3echo -e "+----------------------------------------------------+"
4echo -e "|Codes couleur ANSI : |"
5echo -e "+----------------------------------------------------+"
6echo -e "ESC[xm :"
7echo -e " x = 0 1 2 3 4 5 6 7"
8echo -e " \033[0m abcd \033[0m\033[1m abcd \033[0m\033[2m abcd \033[0m\033[3m abcd \033[0m\033[4m abcd \033[0m\033[5m abcd \033[0m\033[6m abcd \033[0m\033[7m abcd \033[0m"
9echo -e
10echo -e " ------------------------------ "
11echo -e "ESC[x;ym :"
12echo -e " x = 40 41 42 43 44 45 46 47"
13for cpt in 1 4 7; do
14echo -e "y=$cpt \033[40;${cpt}m abcd \033[41;${cpt}m abcd \033[42;${cpt}m abcd \033[43;${cpt}m abcd \033[44;${cpt}m abcd \033[45;${cpt}m abcd \033[46;${cpt}m abcd \033[47;${cpt}m abcd \033[0m"
15done
16cpt=30
17while [ $cpt -lt 38 ]
18do
19echo -e "y=$cpt \033[40;${cpt}m abcd \033[41;${cpt}m abcd \033[42;${cpt}m abcd \033[43;${cpt}m abcd \033[44;${cpt}m abcd \033[45;${cpt}m abcd \033[46;${cpt}m abcd \033[47;${cpt}m abcd \033[0m"
20cpt=`expr $cpt + 1`
21done
22echo -e " ------------------------------ "
23
24