Go Back   Linux Forums by TotalPenguin! Get linux Help! > GUI Linux > Linux Applications

Linux Applications Discussion for Linux Software and Application releated issues.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-29-2007, 08:28 PM
erik
Guest
 
Posts: n/a
Default Command Colors

I'm making a simple shell script and would like to highlight certain words with colors. I thought there was a way to do this using syntax commands but I can't seem to find anything. Does anyone know where they are or what they are?
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-07-2008, 01:52 PM
Tor Tor is offline
Senior Member
 
Join Date: Oct 2007
Posts: 390
Tor is on a distinguished road
Default Bash Shell Colors

I found this cool little function that may help you:

Code:
initializeANSI()
{
  esc=""

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"
  
  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${esc}[47m"

  boldon="${esc}[1m";    boldoff="${esc}[22m"
  italicson="${esc}[3m"; italicsoff="${esc}[23m"
  ulon="${esc}[4m";      uloff="${esc}[24m"
  invon="${esc}[7m";     invoff="${esc}[27m"

  reset="${esc}[0m"
}
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:59 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.