Click to See Complete Forum and Search --> : How do i output pretty colors?
morphman
05-23-2002, 11:02 AM
I want to figure out how to change the color of my output text for a script im writing. There are a couple of messages that are extremely important for the user to pay attention to and id like to make them stand out (maybe with a bright green or something to that effect). I tried reading all about echo but i didnt see anything about the color of the test. If anyone can help id greatly appreciate it!
--Morphman
The Kooman
05-23-2002, 11:28 AM
Originally posted by morphman:
<STRONG>I want to figure out how to change the color of my output text for a script im writing.
--Morphman</STRONG>
try "man terminfo". It shows stuff about color using "tput" (man tput). I have Mandrake 8.2, but I don't think it should mater!
HTH
morphman
05-23-2002, 12:06 PM
Well, i tried reading through some of that and it is way beyond me. I don't think its worth the trouble to try and read that, hehe. I was hoping for something like echo -green "text", hehehe. I guess ill try something else :( Thanks!
Energon
05-23-2002, 12:10 PM
If you do a search, TheLinuxDuck has posted a great link on ways to do this before.
Ben Briggs
05-23-2002, 01:56 PM
Check out CCAE (link in my sig). I made a couple of example with using color.
z0mbix
05-23-2002, 02:30 PM
#! /bin/bash
printf "\033[0;30mThis is Black 0;30\033[0m\n"
printf "\033[1;30mThis is Dark Gray 1;30\033[0m\n"
printf "\033[0;34mThis is Blue 0;34\033[0m\n"
printf "\033[1;34mThis is Light Blue 1;34\033[0m\n"
printf "\033[0;32mThis is Green 0;32\033[0m\n"
printf "\033[1;32mThis is Light Green 1;32\033[0m\n"
printf "\033[0;36mThis is Cyan 0;36\033[0m\n"
printf "\033[1;36mThis is Light Cyan 1;36\033[0m\n"
printf "\033[0;31mThis is Red 0;31\033[0m\n"
printf "\033[1;31mThis is Light Red 1;31\033[0m\n"
printf "\033[0;35mThis is Purple 0;35\033[0m\n"
printf "\033[1;35mThis is Light Purple 1;35\033[0m\n"
printf "\033[0;33mThis is Brown 0;33\033[0m\n"
printf "\033[1;33mThis is Yellow 1;33\033[0m\n"
printf "\033[0;37mThis is Light Gray 0;37\033[0m\n"
printf "\033[1;37mThis is White 1;37\033[0m\n"
:D
morphman
05-23-2002, 06:49 PM
Thanks for the help guys, that was exactly what i was looking for!!! Woohoo! :D