Sponsored Content
Top Forums Shell Programming and Scripting Append color in shell script for output Post 302601642 by Chubler_XL on Friday 24th of February 2012 06:03:40 AM
Old 02-24-2012
27 is the ascii value of the ESC character

The awk program pre-pends <ESC>[41m (VT100 set red rackground)
and appends <ESC>[0m (VT100 reset to normal output).

You can try it out yourself on a xterm/vt* terminal with:

Code:
awk 'BEGIN { printf("%c[41m%s%c[0m\n", 27, "Testing", 27); }'

The above will print Testing with red background.
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

How to append the output continously from a script

Hi All, Am using the below script to produce some statistics. Currently it send the results to a log file and sends the contents of the log to a mail ID. Next time when it runs it erases the previous log and writes the latest output to the log file. I want the output to be appended to... (2 Replies)
Discussion started by: nirmal84
2 Replies

3. Shell Programming and Scripting

.bashrc/PS1 command color different color to command output

I have been configuring my .bashrc PS1 to be displayed with some nice colors and in a format that I like, however there is one thing that I cannot figure out (or know if it's even possible). my PS1 line is as follows: export PS1='\\u\@\\h\:\\w\n\\$ \'This makes the command and command output... (0 Replies)
Discussion started by: jelloir
0 Replies

4. Shell Programming and Scripting

Shell Script to append files

I have several content (text) files in a folder called "content" I have several google ads (text) files in a folder called "google_ads" Example: /content /java websphere.txt android.txt /microsoft framework.txt /c_sharp linq.txt ... (4 Replies)
Discussion started by: rac.mike
4 Replies

5. Shell Programming and Scripting

putting color on output file script

do you have any simple script on how to change the color and font of a string in a script example echo "====================================" echo " sample color script" echo "====================================" echo " hello " echo " bye" on hello,... (3 Replies)
Discussion started by: lhareigh890
3 Replies

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

7. Emergency UNIX and Linux Support

Disk space script output in color

I'm connecting to 15 servers in using ssh and storing disk space details of each server in a text file Finally , I'm emailing that text file at the particular id using mail -x . The report looks something like this. Filesystem size used avail capacity Mounted on /proc ... (30 Replies)
Discussion started by: ajaypatil_am
30 Replies

8. Shell Programming and Scripting

How to print and append output of nawk script in commandline and as well into a file?

Hi All, I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file. Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file. script :... (3 Replies)
Discussion started by: Optimus81
3 Replies

9. Shell Programming and Scripting

How to change the color inside email using shell script?

hi, i want to send an email from unix using mailx command. mailx -s "subject" "email@abc.com" < email.txt Email.txt contains some file names that are transferred successfully and some that failed. so the files that got failed to tranfer, should be displayed in red color in the mail. is it... (1 Reply)
Discussion started by: Little
1 Replies

10. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies
VTTEST(1)						      General Commands Manual							 VTTEST(1)

NAME
vttest - test VT100-type terminal SYNOPSIS
vttest [options] [24x80.132] DESCRIPTION
Vttest is a program designed to test the functionality of a VT100 terminal (or emulator thereof). It tests both display (escape sequence handling) and keyboard. The program is menu-driven and contains full on-line operating instructions. - To run a given menu-item, you must enter its number. - Menu items start at zero; this is the "Exit" item in almost all cases. - You can run all menu-items (for a given level) by entering an asterisk, i.e, `*'. - You can force a repaint of the menu items by entering "?". - A few menus can be more than one page. Use "n" and "p" to switch to the next or previous page. OPTIONS
You can specify the screen geometry in the form [24x80.132], i.e., 24 lines, 80 minimum columns, 132 maximum columns. If your terminal does not switch between 80 and 132 columns you may specify 24x80.80, for example, to avoid a misleading display. Other options are: -f file specify a file containing a DRCS (soft character definition) string. -l log test results to vttest.log. -p use padding, e.g., for a VT100 connected to a high-speed line. -s add time-delay in selected panning/scrolling options to show details. -8 use 8-bit controls (this can be changed with a menu option). AUTHOR
Per Lindberg (mcvax,seismo)!enea!suadb!lindberg sometime 1985. Modified by Thomas Dickey from June 1996, to support nonstandard screen geometry, VT220-VT520, ISO color and xterm-specific tests. LOCAL VTTEST(1)
All times are GMT -4. The time now is 08:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy