Underline


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Underline
# 1  
Old 05-03-2007
Question Underline

i want to print underline under a text using shell or awk.can any body help me regarding this problem?
i hav tried with
echo -e -n "\033[4m
but its not working.
i aslo wana know the awk command for underline
actually i wana to put underline under a certain field
e.g
awk 'Begin {FS;}{print $1" "$2" " $4}'
like expected output is
123 456 12
122 567 13
211 087 14
311 987 15
like the avove
Thank you
regards,
Pankaj.
# 2  
Old 05-03-2007
Pankaj,
See if this would work for you:
Code:
BU=`tput smul`
EU=`tput rmul`
echo "${BU}All underline${EU}"

It may be dependent on termcap/terminfo.
# 3  
Old 05-03-2007
Quote:
Originally Posted by panknil
i want to print underline under a text using shell or awk.can any body help me regarding this problem?
i hav tried with
echo -e -n "\033[4m
but its not working.
i aslo wana know the awk command for underline
actually i wana to put underline under a certain field
e.g
awk 'Begin {FS;}{print $1" "$2" " $4}'
like expected output is
123 456 12
122 567 13
211 087 14
311 987 15
like the avove

The command is any command that sends the correct escape sequence to the screen. The sequence doesn't change.

Shell:

Code:
printf "\e[4m%s\e[0m\n" TESTING

AWK:
Code:
printf "\e[4m%s\e[0m\n", "TESTING"

If your terminal isn't standard, it may not support underlining, or may require a different sequence. These days, such terminals are rare, but you may be able to get the sequence with tput.. Read the man pages for tput and terminfo and/or termcap.


Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert header with underline?

How to insert header with underline AM able to insert only header not underline sed '1i NAME COUNTRY' test.txt input file UK 1234 USA 2354 AUS 2253 IND 4256 Output file NAME COUNTRY_CODE ---- ------------ UK 1234 USA 2354 AUS 2253 IND 4256 (5 Replies)
Discussion started by: Kalia
5 Replies

2. Shell Programming and Scripting

Help with underline text based on specific region

Input file 2 5 ASFGEWTEWRQWEQ 10 20 QEWIORUEIOUEWORUQWEQWRQRQWGQWGFQ 1 6 WRQTQWTQTQWTQT Desired output file 2 5 ASFGEWTEWRQWEQ 10 20 QEWIORUEIOUEWORUQWEQWRQRQWGQWGFQ 1 6 WRQTQWTQTQWTQT Column 1 is the start region of underline the text in column 3; Column 2 is the end region of... (13 Replies)
Discussion started by: cpp_beginner
13 Replies

3. Shell Programming and Scripting

Color Underline and Bold letter in shell script

Hi All, This is my first port..... I am using AIX 5L, installed 10g database. On daily basis we takes rman backup. This backup status info strored in a log file. I write a script to know the status of back means I will fire this script and this script will send a mail to me. #!/bin/bash... (16 Replies)
Discussion started by: mcagaurav
16 Replies

4. Shell Programming and Scripting

Bold and Underline - not displyed in more/less/vi

I have a script main.shl which has few lines like this #bold tput smso echo "\t\tsome statement\t\t" tput rmso I am executing the main.shl from the shell and redirected its output to a separate file like this $main.shl >main.log 2>&1 & once after running this script, if I "cat" the... (0 Replies)
Discussion started by: ramkrix
0 Replies

5. 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

6. UNIX for Dummies Questions & Answers

underline character in vi editor

I want to print a man page for a command in unix, this is what I did man command > command.txt but when I view the output file command.txt I found there are lot of _^H characters that in the man page are actually underline character, how can I replace this _^H with underline character? ... (2 Replies)
Discussion started by: Melissa
2 Replies
Login or Register to Ask a Question