LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-08-2004, 02:38 AM   #1
Beppe83
Member
 
Registered: Mar 2004
Posts: 41

Rep: Reputation: 15
Colorize Text in Bash?


How can I apply color to an "echo" output text?

Ex:

echo "Hello World!"

How to make it...mmm yellow?

Thanks!
 
Old 06-08-2004, 04:31 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Code:
echo -e '\E[1;33mHello world!'; tput sgr0
Is one way...

Code:
echo -en "\033[1;33mHello World! \033[0m\n"
is another. You will want to read up on ansi color codes

Code:
for i in 30 31 32 33 34 35 36 37; do echo -en "\033[1;${i}m Hello World! \033[0m\n"; done
will show you the rainbow.

Last edited by bulliver; 06-08-2004 at 04:43 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script text replacement... matthurne Programming 4 06-07-2011 07:46 PM
Create a text file using Bash Boffy Programming 5 03-14-2005 10:06 PM
BASH text executable blackbox Linux - Newbie 1 02-28-2005 07:49 AM
Set 'ls' to automaticly colorize under e-term? dushkinup Linux - Software 0 03-10-2004 01:11 AM
Text input in bash? pk21 Programming 12 06-05-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration