Font colors in bash

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: JD Austin
Date:  
Subject: Font colors in bash
> I am playing with the color schemes that knoppix uses when outputing
> message while booting.
>
> CRE="^M^[[K"
> NORMAL="^[[0;39m"    #Normal Color
> RED="^[[1;31m"        #Failure
> GREEN="^[[1;32m"    #Success
> YELLOW="^[[1,33m"    #Unused
> BLUE="^[[1;34m"        #System Messages
> MAGENTA="^[[1;35m"    #Description
> CYAN="^[[1;36m"        #Unused
> WHITE="^[[1;37m"    #Unused

>
> But I'm failing somewhere.
> I tried
> echo "${BLUE}Hello there.${NORMAL}"
>
> But, it doesn't work.
> it comes back
> echo "^[[1;31mHello there.^[[0;39m
>
> How do I make this work? Obviously I've never used ansi colors before.


The first ^[ is the escape character. Im not sure how you'd put a chr(27) in
that file without some sort of editor (nedit lets you do that); does the alt-#
thing still work (forgot how that worked)?

JD

--
JD Austin IV
Cell: 480.204.0540
Twin Geckos Technology Services
http://www.twingeckos.com