Possible Duplicate:
color text in terminal aplications in unix
I am working on a small Unix shell (written completely in C), and am wondering how to copy bash's prompt coloring technique. Are there libraries to do that? Has anyone ever tried them?
Possible Duplicate:
color text in terminal aplications in unix
I am working on a small Unix shell (written completely in C), and am wondering how to copy bash's prompt coloring technique. Are there libraries to do that? Has anyone ever tried them?
You can use simple shell escape commands like \033[31mRed\033[0m or use the ncurses library.
Googling ncurses will give you all you need to get started.
The easiest way to do colorization in the unix shell is to use a library like curses / ncurses. It provides a portable way to implement items like corolization in the unix shell.
Here's a link to a nice tutorial on it