font color in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting font color in script
# 1  
Old 06-21-2011
font color in script

i am using ubuntu 11.04 and i just finished writing a shell script but i was wanting to know if their is a way to change the font color of just one sentence?
# 2  
Old 06-21-2011
ANSI color codes?

echo -e '\033[0;31mhello' will make red for example.

have a look at ASCII Table - ANSI Escape sequences

\033 is ESC in octal. End with 0m to return to normal


mute@geek:~/test$ echo -e '\033[0;31mred\033[0;32mgreen\033[0;34mblue\033[0mnormal'
redgreenbluenormal
# 3  
Old 06-22-2011
thanks for the help! it worked!
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send mail with font color change

Hi All, I have a file that contains following entries. I want to highlight the line that has word as "FAILURE" while sending the email. File ------------------------------------------------------------ Job Name: ABC Start Time: 07/20/2019 07:32:39 End Time: 07/20/2019... (4 Replies)
Discussion started by: sdosanjh
4 Replies

2. UNIX for Advanced & Expert Users

How to set font color for STDIN,STDOUT and STDERR?

I want to differentiate the STDOUT and STDERR messages in my terminal . If a script or command is printing a message in terminal I want to differentiate by colors, Is it possible ? Example: $date Wed Jul 27 12:36:50 IST 2011 $datee bash: datee: command not found $alias ls alias... (2 Replies)
Discussion started by: ungalnanban
2 Replies

3. Shell Programming and Scripting

Change color or font when executing a script

I'm writing a simple menu script and I would like to output the whole script using background color: black AND foreground color:white. Meaning if the ssh terminal of a user is set to green for example, it will change to my desired color when menu script is executed. Once the script is exited, it... (1 Reply)
Discussion started by: lhareigh890
1 Replies

4. Shell Programming and Scripting

Specifying font type and color in a shell script

Hi, I am new to shell script. Can you please tell me, whether can we specify font type and color in a shell script? If so, how to do this? Thanks in advance. (4 Replies)
Discussion started by: Vani_Govind
4 Replies

5. UNIX for Dummies Questions & Answers

How to change the font or color of text

Hi Gurus, I have a small requirement where i want to change the color & font of some text in a file. i have a file error.txt which will be created in the script using egrep. After that iam adding these lines at head & tail to that file using the following code awk 'BEGIN{print"Please... (4 Replies)
Discussion started by: pssandeep
4 Replies

6. Shell Programming and Scripting

Font Color Change Using .profile

Does anyone know how can I change font color, background color etc for a particular user using .profile? Any help is appreciated. (0 Replies)
Discussion started by: fifo_vs_lifo23
0 Replies

7. Shell Programming and Scripting

Changing font and color in log file of Script

Hi, We have process log with user defined error messages and information echos. I wanted to highlight error messgaes in that log file while writing in it. Is there any option with either echo or any other command which enables making text bold or we can change the font of body text of echo. ... (4 Replies)
Discussion started by: satgo
4 Replies
Login or Register to Ask a Question