[Eug-lug] To Horst-Q/colours
Bob Miller
kbob at jogger-egg.com
Wed Jan 12 15:23:09 PST 2005
Allen Brown wrote:
> This is not working for me. All I get is a box where I try to
> print the escape char, followed by the other chars.
> ESC=$(echo -ne "\033")
> echo -e "${ESC}31;1foo"
> should print a red "foo". Instead I get
> []31;1foo
> where [] represents a single character.
Uh, the sequence you need to output is
escape left-bracket number semicolon one letter-m
And to return to normal color, you need to output
escal left-bracket letter-m
Or, in bash syntax,
echo "${ESC}[31;1mfoo${ESC}[m"
Did you catch the python script I sent out last week on this topic?
--
Bob Miller K<bob>
kbobsoft software consulting
http://kbobsoft.com kbob at jogger-egg.com
More information about the EUGLUG
mailing list