BASH change color of text ?

dave selby dave6502 at googlemail.com
Tue Mar 11 20:24:07 UTC 2008


Hi all,

I need to change the terminal text color when printing a warning. So
far in python the following works a treat ...

print """
\033[1;32mAll configurations have been regenerated and reloaded.

\033[1;31m*WARNING* If you have changed
../apache2_config/kmotion_vhost_template you need to :\n
sudo /etc/init.d/apache2 restart\033[1;37m\n
"""

However I need a bash script to do the same ...

dave at dev-machine:/var/lib/kmotion/daemons$ print "\033[1;32mkmotion
has been started\033[1;37m"
Warning: unknown mime-type for "\033[1;32mkmotion has been
started\033[1;37m" -- using "application/*"
Error: no such file "\033[1;32mkmotion has been started\033[1;37m"
dave at dev-machine:/var/lib/kmotion/daemons$

Can anyone tell me how to get this to work via bash print ?

Cheers

dave




-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html




More information about the ubuntu-users mailing list