Assuming you have a standard terminal (e.g. gnome-terminal) and you're writing a script in /bin/bash (please, can you clarify?) a method can be:
Code:
tput setaf 1
echo Hello world\!
tput setaf 0
this should print the string "Hello world!" in red. By this method you have 8 basic colors available, numbered from 0 (black) to 7. The setaf string in the above commands stats for "set ANSI foreground". See
man tput and
man terminfo for details. The latter contains a list of available colors (see section "Colors").