The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
color,bold charandevu Shell Programming and Scripting 0 04-07-2008 03:24 AM
How can i make this bold moe2266 UNIX for Dummies Questions & Answers 10 08-06-2007 12:13 PM
Bold text svh High Level Programming 3 08-29-2005 01:04 AM
Bold the paragraph caprikar Shell Programming and Scripting 3 12-22-2003 06:44 PM
Bold Text? Atama UNIX for Dummies Questions & Answers 4 04-12-2002 09:40 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-17-2008
jakSun8 jakSun8 is offline
Registered User
  
 

Join Date: Dec 2007
Location: Gotham City
Posts: 59
ksh - how to echo something in color and bold

Hi all,

I was to echo Hi in Red and Bold ; and echo There is in Green and bold

I got bold to working using tput bold but i am having hard time getting the color.

Any help is appreciated,
jak
  #2 (permalink)  
Old 03-17-2008
pupp's Avatar
pupp pupp is offline Forum Staff  
cap_10hdx 1
  
 

Join Date: Feb 2008
Location: Jersey Shore
Posts: 548
echo "\033[1;31mhi\033[m"
echo "\033[1;32mthere \033[m"
  #3 (permalink)  
Old 03-18-2008
frajer frajer is offline
Registered User
  
 

Join Date: Sep 2005
Location: Slovenija
Posts: 20
What exactly change text colour and/or bold/offbold?

red: echo "\033[1;31mhi\033[m"
green: echo "\033[1;32mhi\033[m"
yellow: echo "\033[1;33mhi\033[m"
blue: echo "\033[1;34mhi\033[m"

Franci

Last edited by frajer; 03-18-2008 at 05:25 AM..
  #4 (permalink)  
Old 03-19-2008
faltooweb faltooweb is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 11
ksh - how to echo something in color and bold

Here are the color codes and others:

LF="\n"; CR="\r"
INVT="\033[7m"; NORM="\033[0m"; BOLD="\033[1m"; BLINK="\033[5m"
#UNDR="\033[2m\033[4m"; EOL="\033[0K"; EOD="\033[0J"
UNDR="\033[4m"; EOL="\033[0K"; EOD="\033[0J"
SOD="\033[1;1f"; CUR_UP="\033[1A"; CUR_DN="\033[1B"; CUR_LEFT="\033[1D"
CUR_RIGHT="\033[1C"

#-- ANSI code
SCR_HOME="\033[0;0H" #-- Home of the display

BLACK_F="\033[30m"; BLACK_B="\033[40m"
RED_F="\033[31m"; RED_B="\033[41m"
GREEN_F="\033[32m"; GREEN_B="\033[42m"
YELLOW_F="\033[33m"; YELLOW_B="\033[43m"
BLUE_F="\033[34m"; BLUE_B="\033[44m"
MAGENTA_F="\033[35m"; MAGENTA_B="\033[45m"
CYAN_F="\033[36m"; CYAN_B="\033[46m"
WHITE_F="\033[37m"; WHITE_B="\033[47m"

Example: bold
echo "${BOLD}Bold test ${NORM}"

-Ramesh
  #5 (permalink)  
Old 03-19-2008
jakSun8 jakSun8 is offline
Registered User
  
 

Join Date: Dec 2007
Location: Gotham City
Posts: 59
Thanks for all your help.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 -4. The time now is 12:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0