?

Log in

No account? Create an account

Previous Entry | Next Entry

Colors in BASH

BASH got this feature as well, background and foreground color options for text. Here is a short discussion on the color codes and their use.





Note:
echo -e '\E[COLOR1;COLOR2m THE TEXT.'
tput sgr0 = > Reset text attributes to normal without clear. 

The Following BASH code will print all the color combinations:

#!/bin/bash

for i in `seq 30 37`
        do
        for j in `seq 40 47`
                do
                echo -e '\E['$i';'$j'm TEXT'
                tput sgr0
                done
done

Profile

jaduks
Jadu Kumar Saikia

Latest Month

January 2008
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  
Powered by LiveJournal.com
Designed by chasethestars