Results 1 to 4 of 4

Thread: How to echo with colors?

  1. #1
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Exclamation How to echo with colors?

    hey all,
    Can someone give me the code of echo with colors?
    and i need the table of colors please!

    thanks alot.

  2. #2
    Junior Member
    Join Date
    Apr 2008
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    syntax : echo -e "\033[escape-code your message"
    ex : echo -e "\033[32m Hello World"

    Escape code '[32m'
    30-37 : set foreground color
    40-47 : set background color
    0 : normal screen
    Linux Shell Scripting Tutorial v1.05r3 > Misc. Linux/Unix definition
    Last edited by demuytree; 16th August 2008 at 08:45 AM.

  3. #3
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Default

    thank you demuytree

  4. #4
    Junior Member
    Join Date
    Apr 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Wink

    Quote Originally Posted by demuytree View Post
    syntax : echo -e "\033[escape-code your message"
    ex : echo -e "\033[32m Hello World"

    Escape code '[32m'
    30-37 : set foreground color
    40-47 : set background color
    0 : normal screen
    Linux Shell Scripting Tutorial v1.05r3 > Misc. Linux/Unix definition
    plz tell me what is the significance of '\033 & m '
    why it is only \033 not some other number?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. UNIX / Linux echo command examples
    By raj in forum Getting started tutorials
    Replies: 8
    Last Post: 15th November 2009, 02:18 AM
  2. displaying the executed command then echo the status
    By warren in forum Shell scripting
    Replies: 4
    Last Post: 29th November 2006, 01:56 AM

Posting Permissions

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