Make bold chars in UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Make bold chars in UNIX
# 1  
Old 03-17-2015
Make bold chars in UNIX

Hi all,

I want to make the string as bold in unix.
is there any way to acheive this?

thanks in advance.
# 2  
Old 03-17-2015
it depends on your terminal and UNIX variant.

you can try:
Quote:
tput bold
or better -
Quote:
man tput
# 3  
Old 03-17-2015
Just to add to agent.kgb...

You could do:

Code:
b=`tput bold`
c=`tput sgr0`
echo "Hello ${b}ShekhaReddy${c}. Welcome to the forums."

This User Gave Thanks to cjcox For This Post:
# 4  
Old 03-17-2015
On linux, you may consider man console_codes as well. On (Free)BSD, tput bold doesn't work. You need to refer to the terminal capabilities, found in e.g. /etc/termcap. Try tput md.

Last edited by RudiC; 03-17-2015 at 03:54 PM..
# 5  
Old 03-17-2015
Or try:
Code:
printf '\e[1m%s\e[0m\n' "Hello there"

# 6  
Old 03-17-2015
Quote:
Originally Posted by Scrutinizer
Or try:
Code:
printf '\e[1m%s\e[0m\n' "Hello there"

You really do *not* want to hardcode terminal escapes since they are terminal dependent. Better to query capabilities.

Sad to hear that FreeBSD stayed with the outdated termcap format. Supposedly if you add ncurses devel support to FreeBSD you'll get terminfo. Still it's sort of sad really.

I believe OpenBSD and NetBSD moved forward. It's strange to me that FreeBSD stayed behind on this.
# 7  
Old 03-18-2015
Thanks for your replies.

I found the below codes are working in command prompt. i.e

echo "one $(tput bold) two$(tput sgr0) three"

tput bold is to make bold text and tput sgr0 is to bring normal mode.
When i try with this code it is working fine in command prompt.
But i want to make this bold chars in flat file.
I mean my target is flat file. While writing the out put to flat file, it needs to make bold in headings .This needs to be achieve via informatica .

Please help me on this.

thanks in advance....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to split data with a delimiter having chars and special chars

Hi Team, I have a file a1.txt with data as follows. dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><! The delimiter string: <SelectStatement modified='1' type='string'><! dlm="<SelectStatement modified='1' type='string'><! The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies

2. Shell Programming and Scripting

Removing formats (bold) from UNIX file

Hi , Could you please guide me how to remove formatting (bold text) in a unix file? vi editor showing like this... ^ Cat command showing like this... tl21ss01 tl21ss02 tl21ss03 (6 Replies)
Discussion started by: suresh3566
6 Replies

3. Shell Programming and Scripting

Bold chars redirect to CSV

Is there any way to redirect characters in bold to .csv file using KSH. I need to open this csv in MS EXCEL. thanks (4 Replies)
Discussion started by: param_it
4 Replies

4. Shell Programming and Scripting

find 4 chars on 2nd line, 44 chars over

I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :( I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Discussion started by: unclecameron
4 Replies

5. Programming

Unix Make

I need tutorial on Make utility on Unix. Any help or link appreciated. many thanks Mirko (3 Replies)
Discussion started by: mmipko
3 Replies

6. Shell Programming and Scripting

How to convert C source from 8bit chars to 16bit chars?

I was using the following bash command inside the emacs compile command to search C++ source code: grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d' Emacs will then position me in the correct file and at the correct line... (0 Replies)
Discussion started by: siegfried
0 Replies

7. UNIX for Dummies Questions & Answers

How can i make this bold

Folks; I'm writing this as a part of a script: echo "col1 hdg|col2hdg|col3hdg|" How can i make these fields shows in Bold text? (10 Replies)
Discussion started by: moe2266
10 Replies

8. UNIX for Dummies Questions & Answers

how to make a bold text in vi

pls disregard got my question answered . as you can't do bold in vi (0 Replies)
Discussion started by: xzyan
0 Replies

9. Shell Programming and Scripting

Hidden chars in Unix can be replaced?

We have some unseen chars in unix, like '^T's, can be seen with 'cat -v' command. Is there any way, with which, we can replace these ^T s with a space? (1 Reply)
Discussion started by: videsh77
1 Replies

10. Programming

How can I make ls -l in HP-UNIX?

I made a liitle source about that.. BUt I got a trouble when making files'authority.. How can I display them?? p.s.) used struct stat .. (1 Reply)
Discussion started by: sangjinn
1 Replies
Login or Register to Ask a Question