April 29th, 2004, 11:38 PM
How do we change text color in Unix using bash shell
How do we change text color in Unix using bash shell.
Can any one help? I am having trouble to change the text color.
April 29th, 2004, 11:42 PM
Well I'm not sure exactly what you are trying to do but here is a small example:
/* black bg, with red text */
#define BR "\033[1;31m"
/* back to normal text */
#define NORMAL "\033[0m"
printf(BR "red text, black background" NORMAL);
April 30th, 2004, 12:52 AM
I try it and it doesn't work.
For example when the user enter somthing wrong.
then I would like to give an error message display in red to get their attention and make my point stand out.
Can anyone help please
April 30th, 2004, 02:30 AM
The previous answer is correct
Colors are controlled by escape sequences. Are you sure your terminal supports colors? Does ls --color=auto give you a file listing with colors?