output text in bold font using SED


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting output text in bold font using SED
# 1  
Old 07-17-2012
output text in bold font using SED

hi I want to write a script, while using the SED editor, to output the text, in this case a variable, to the result file but highlighted it in bold, is it possible to do that? can you tell me how?

eg. in text.txt

Code:
sed '$ a\
'$variable'
     ' <text.txt >text2.txt

so it will add the variable after the last line in the text.txt file, but preferably in bold

Thanks
Robert

Last edited by Franklin52; 07-17-2012 at 09:42 AM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 07-17-2012
Try this:
Code:
sed '$ a\
  '$(tput bold)$variable$(tput sgr0)'
    ' <text.txt >text2.txt

# 3  
Old 07-18-2012
Thanks for your reply.

Which program would you use to open the text file to see the effect? it seems if I open it in normal text editor like nedit or emacs you don't see any word formatting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Slowly Removing Bold Font Style - Step-by-Step

FYI, I'm slowly removing a lot of the bold font-styles from titles of discussions, forum titles, etc I'm not removing bold for the entire site because we do need bold from time to time, especially in posts and sometimes in other places. However, the original forum style had way too much... (3 Replies)
Discussion started by: Neo
3 Replies

2. Shell Programming and Scripting

Need way to grep the following output in bold

Hi guys, i am not able to work this out, i need to write a script to monitor the usage of IO DISK READ whenever the IO is above 600MB it will send an email. So far not able to. Hope you guys can assist me. Thanks! # iotop -bot --iter=3 |grep DISK|egrep -v TIME 05:22:04 Total DISK READ : ... (8 Replies)
Discussion started by: jaapar
8 Replies

3. Shell Programming and Scripting

[awk] Math & Bold-Font?

Heya There is a script which has presets stored in a tab-seperated file. That script also has $help_text, which will be shown when called with invalid arguments or -h. So i do need to have that file ready, so the help text can get the values out of the file, and print it with the $help_text.... (17 Replies)
Discussion started by: sea
17 Replies

4. Shell Programming and Scripting

Change the font of text in output file in shell scipt

hi, I want to change the font of text in output file. :( I tried the below code code: if awk 'BEGIN{if('$RSS'>='1000')exit 0;exit 1}' then RED=`echo "\033 i can see colors in terminal but not in output file :wall: please help me how i can get colors text in output file. edit... (1 Reply)
Discussion started by: sreelu
1 Replies

5. UNIX for Dummies Questions & Answers

Bold Text In Email

Hello, I email some info daily to my employees using a script. But they tend to overlook an important part so I wanted to bold that particular section. Everyone here uses outlook to receive their emails. I would like to know how to send an email to my employees with some parts in bold. (3 Replies)
Discussion started by: Amonkira
3 Replies

6. Shell Programming and Scripting

how can i bold a text

Dear i want to bold a text using shell script. please give sample.. Thanks rex (1 Reply)
Discussion started by: jrex1983
1 Replies

7. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

8. Programming

Bold text

hello, how do i display the text in the printf statement in bold. or is there anyway to display the text on the console in bold thx in advance svh (3 Replies)
Discussion started by: svh
3 Replies

9. UNIX for Dummies Questions & Answers

How to underline/bold and how to align output

Hi, I work with AIX 5 and have two basic questions: 1) How do I underline/bold a word in a text output? Any way to do it with echo command? basic example: echo "FOLDER " >> folder.txt ( I wish the word FOLDER to be underlined and bold). 2) Suppose I have the following pipe delimited... (1 Reply)
Discussion started by: clara
1 Replies

10. UNIX for Dummies Questions & Answers

Bold Text?

Hello, On the linux box I use at work, the directories are bold type to distinguish them. Is there a way to make certain words in a text file bold? Thanks! (4 Replies)
Discussion started by: Atama
4 Replies
Login or Register to Ask a Question