Sponsored Content
Full Discussion: Underline
Top Forums Shell Programming and Scripting Underline Post 302116394 by cfajohnson on Thursday 3rd of May 2007 05:05:03 PM
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.


 

6 More Discussions You Might Find Interesting

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

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

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

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

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

6. 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
TPUT(1) 						    BSD General Commands Manual 						   TPUT(1)

NAME
tput, clear -- terminal capability interface SYNOPSIS
tput [-T term] attribute ... clear DESCRIPTION
The tput utility makes terminal-dependent information available to users or shell applications. When invoked as the clear utility, the screen will be cleared as if tput clear had been executed. The options to tput are as follows: -T The terminal name as specified in the termcap(5) database, for example, ``vt100'' or ``xterm''. If not specified, tput retrieves the ``TERM'' variable from the environment. The tput utility outputs a string for each attribute that is of type string; a number for each of type integer. Otherwise, tput exits 0 if the terminal has the capability and 1 if it does not, without further action. If an attribute is of type string, and takes arguments (e.g. cursor movement, the termcap ``cm'' sequence) the arguments are taken from the command line immediately following the attribute. The following special attributes are available: clear Clear the screen (the termcap(5) ``cl'' sequence). init Initialize the terminal (the termcap(5) ``is'' sequence). longname Print the descriptive name of the user's terminal type. reset Reset the terminal (the termcap(5) ``rs'' sequence). EXIT STATUS
The exit status of tput is as follows: 0 If the last attribute attribute argument is of type string or integer, its value was successfully written to standard output. If the argument is of type boolean, the terminal has this attribute. 1 This terminal does not have the specified boolean attribute. 2 Usage error. 3 No information is available about the specified terminal type. SEE ALSO
termcap(5), terminfo(5) STANDARDS
The tput utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The tput utility appeared in 4.4BSD. BUGS
The tput utility cannot really distinguish between different types of attributes. Some termcap entries depend upon having a '%' in them that is just a '%' and nothing more. Right now we just warn about them if they do not have a valid type declaration. These warnings are sent to stderr. BSD
June 15, 2002 BSD
All times are GMT -4. The time now is 07:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy