Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Anyone know how to output pretty colors?
Results 1 to 5 of 5

Thread: Anyone know how to output pretty colors?

  1. #1

    Anyone know how to output pretty colors?

    I have a few important messages in my script that i really want to stand out and im trying to figure out how to change the color of the text (a nice bright green or something like that would be great!) I didnt see anything in the man pages for echo or elsewhere. Does anyone know how to do this? Once again, any help you can provide would be great!
    --Morphman

  2. #2

    Re: Anyone know how to output pretty colors?

    NORMAL="echo -en \\033[0;39m"
    SUCCESS="echo -en \\033[1;32m"
    WARNING="echo -en \\033[1;33m"
    FAILURE="echo -en \\033[1;31m"

    it should work if you use this in a bash script ..
    normal = black
    succes = green
    warning = yellow
    failure = red ..
    play with the last characters to get other colors 1;32, 1;22 .. and so on ..

  3. #3

    Re: Anyone know how to output pretty colors?

    uhh..... holy crap? I was hoping for something like "echo -green "text"" hehe, if only linux was so easy...
    So what exactly would i put in my script to go from one line:
    echo Please insert the cd...
    to the next line which would say
    echo CLOSE THE WINDOW THAT OPENS WHEN THE CD IS AUTOMOUNTED!!!!
    in the color green and then switch back to default colors? Thanks for the help so far! Im sorry to be such a newbie....
    --Morphman

  4. #4

    Re: Anyone know how to output pretty colors?

    hmm .. i made a little script to demonstrate how it works :
    Code:
    #!/bin/sh
    NORMAL="echo -en \\033[0;39m"
    GREEN="echo -en \\033[1;32m"
    YELLOW="echo -en \\033[1;33m"
    RED="echo -en \\033[1;31m"
    
    $RED
    echo "CLOSE THE WINDOW THAT OPENS WHEN THE CD IS AUTOMOUNTED"
    $NORMAL # set back to normal
    echo -n "something "
    $YELLOW
    echo "else.."
    
    $NORMAL #dont forget or you terminal will stay in the last used color

  5. #5

    Re: Anyone know how to output pretty colors?

    Now thats more like it! Perfect, thanks a lot man! Woohoo! *does a happy dance*

Similar Threads

  1. New Colors
    By peter in forum Announcements and Suggestions
    Replies: 2
    Last Post: 10-02-2006, 02:58 AM
  2. Vote for new forum colors
    By peter in forum Announcements and Suggestions
    Replies: 22
    Last Post: 03-04-2006, 03:05 AM
  3. Boring Colors
    By peter in forum Announcements and Suggestions
    Replies: 7
    Last Post: 02-14-2006, 05:26 PM
  4. Mac ssh colors & mouse
    By flashingcurser in forum Linux Distros
    Replies: 1
    Last Post: 03-29-2005, 03:27 AM
  5. BASH colors
    By airhead in forum Linux - General Topics
    Replies: 4
    Last Post: 05-11-2002, 09:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •