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
PCSCTEST(8)							    User Manual 						       PCSCTEST(8)

NAME
pcsctest SYNOPSIS
pcsctest DESCRPTION
pcsctest runs a test on pcscd, lists the readers currently connected, and displays card information if a card is inserted. OPTIONS
None USAGE
pcsctest lists the currently connected readers and asks the user to choose one. After choosing the reader, pcsctest will ask the user to insert a card into the card reader. If this happens pcsctest will display the cards's ATR and other information. Example: The following will occur if no reader is inserted and recognized: MUSCLE PC/SC Lite Test Program Testing SCardEstablishContext : Command successful. Testing SCardGetStatusChange Once a reader is inserted and recognized the following will occur: MUSCLE PC/SC Lite Test Program Testing SCardEstablishContext : Command successful. Testing SCardGetStatusChange Please insert a working reader : Command successful. Testing SCardListReaders : Command successful. Reader 01: SCM SCR-331 CCID 0 0 Enter the reader number : 1 Waiting for card insertion : Command successful. Testing SCardConnect : Command successful. Testing SCardStatus : Command successful. Current Reader Name : CCID USB Reader 0 0 Current Reader State : 34 Current Reader Protocol : 0 Current Reader ATR Size : 9 Current Reader ATR Value : 3B E2 00 00 04 03 00 Testing SCardDisconnect : Command successful. Testing SCardReleaseContext : Command successful. PC/SC Test Completed Successfully ! SEE ALSO
pcscd(8) BUGS
MacOSX March 2003 PCSCTEST(8)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy