Sponsored Content
Top Forums Shell Programming and Scripting Change the font of text in output file in shell scipt Post 302523097 by sreelu on Wednesday 18th of May 2011 12:16:38 AM
Old 05-18-2011
Question Change the font of text in output file in shell scipt

hi,

I want to change the font of text in output file. Smilie

I tried the below code
code:
Code:
if awk 'BEGIN{if('$RSS'>='1000')exit 0;exit 1}'
then
RED=`echo "\033[31m"`
echo "${RED} $Process exceeds 1000M on $PID \033[0m" >>output.txt
else
GREEN=`echo "\033[32m"`
echo "${GREEN} Memory Utilization is normal for $Process on $PID \033[0m" >>output.txt
fi

i can see colors in terminal but not in output file Smilie

please help me how i can get colors text in output file.

Moderator's Comments:
Mod Comment edit by bakunin: Please use CODe-tags when posting code or terminal output to enhance readability. With so many posts under your belt you could know that already.

Last edited by bakunin; 05-18-2011 at 02:48 AM.. Reason: code taqgs
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hw to change the font of output in perl

Hw to change the font color and size of output in perl (2 Replies)
Discussion started by: trupti_rinku
2 Replies

2. UNIX for Dummies Questions & Answers

How to change the font or color of text

Hi Gurus, I have a small requirement where i want to change the color & font of some text in a file. i have a file error.txt which will be created in the script using egrep. After that iam adding these lines at head & tail to that file using the following code awk 'BEGIN{print"Please... (4 Replies)
Discussion started by: pssandeep
4 Replies

3. Shell Programming and Scripting

running db2 sql and exporting output from ksh scipt

Hi there, I am trying to write a shell script as root on AIX 5.3 where I change user to db2inst1, connect to our db2 database, run a sql select query and export the result of the query to a file. The code I have so far is as follows:- #!/usr/bin/ksh su - db2inst1 -c "db2 connect to... (0 Replies)
Discussion started by: candlino
0 Replies

4. Shell Programming and Scripting

how to make a line BLINKING in output and also how to increase font size in output

how to make a line BLINKING in output and also how to increase font size in output suppose in run a.sh script inside echo "hello world " i want that this should blink in the output and also the font size of hello world should be big .. could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies

5. AIX

how to change the font size of shell in $ prompt

Can any help me to change the default font type and its size.. To clear more about my question.. Once i login to my unix domain... the font it displaying is of small size... all my shell commands i am executing in $ prompt also carries the same style(ls, date and echo...) i searched whole... (2 Replies)
Discussion started by: tsjpraveen
2 Replies

6. Shell Programming and Scripting

Change the font of the attached file while using sendmail

Hi, I have one file which needs to be mailed through sendmail. I am using the following command to send this file to end users. But before sending how can I change the font of the input file to "Courier New" as the mail content was not in proper format if it is any other font. printf... (1 Reply)
Discussion started by: Kattoor
1 Replies

7. Shell Programming and Scripting

generate tabular output from an input text file in unix shell scripting

Hi, I have the output (as below) which i want it to be in a table. For e.g. space utilization in PSE on path /logs is 0% space utilization in PSE on path /logs/tuxedo/tuxlsp is 16% space utilization in PSE on path /ldvarlsp/lsp/log is 37% space utilization in PSE on path /home is 6%... (7 Replies)
Discussion started by: pkbond
7 Replies

8. Shell Programming and Scripting

output text in bold font using SED

hi I want to write a script, while using the SED editor, to output the text, in this case a variable, to the result file but highlighted it in bold, is it possible to do that? can you tell me how? eg. in text.txt sed '$ a\ '$variable' ' <text.txt >text2.txt so it will add the... (2 Replies)
Discussion started by: piynik
2 Replies

9. UNIX for Beginners Questions & Answers

Need list of input and output parameter of task in a text file, using shell script

//file begin ===== //some code task abcd_; input x; input y,z; //some comment output w; //some comment reg p; integer q; begin //some code end endtask : abcd_ //some code //file end ===== expected output from above... (1 Reply)
Discussion started by: rishifrnds
1 Replies

10. UNIX for Beginners Questions & Answers

Change text font to greater one in this very good MOTIF texteditor ?

Hi, i have here found a very good texteditor source code programmed in the MOTIF GUI language. For myself i need NOTHING else to program. To start from a very easy point of view i want to RUN this editor on my LINUX machine and type simple C code. The reason for this post is that the text... (7 Replies)
Discussion started by: Sennenmut
7 Replies
QwtPlainTextEngine(3)						 Qwt User's Guide					     QwtPlainTextEngine(3)

NAME
QwtPlainTextEngine - A text engine for plain texts. SYNOPSIS
#include <qwt_text_engine.h> Inherits QwtTextEngine. Public Member Functions virtual void draw (QPainter *painter, const QRect &rect, int flags, const QString &text) const virtual int heightForWidth (const QFont &font, int flags, const QString &text, int width) const virtual bool mightRender (const QString &) const QwtPlainTextEngine () virtual void textMargins (const QFont &, const QString &, int &left, int &right, int &top, int &bottom) const virtual QSize textSize (const QFont &font, int flags, const QString &text) const virtual ~QwtPlainTextEngine () Detailed Description A text engine for plain texts. QwtPlainTextEngine renders texts using the basic Qt classes QPainter and QFontMetrics. Constructor &; Destructor Documentation QwtPlainTextEngine::QwtPlainTextEngine () Constructor. QwtPlainTextEngine::~QwtPlainTextEngine () [virtual] Destructor. Member Function Documentation void QwtPlainTextEngine::draw (QPainter *painter, const QRect &rect, intflags, const QString &text) const [virtual] Draw the text in a clipping rectangle. A wrapper for QPainter::drawText. Parameters: painter Painter rect Clipping rectangle flags Bitwise OR of the flags used like in QPainter::drawText text Text to be rendered Implements QwtTextEngine. int QwtPlainTextEngine::heightForWidth (const QFont &font, intflags, const QString &text, intwidth) const [virtual] Find the height for a given width Parameters: font Font of the text flags Bitwise OR of the flags used like in QPainter::drawText text Text to be rendered width Width Returns: Calculated height Implements QwtTextEngine. bool QwtPlainTextEngine::mightRender (const QString &) const [virtual] Test if a string can be rendered by this text engine. Returns: Always true. All texts can be rendered by QwtPlainTextEngine Implements QwtTextEngine. void QwtPlainTextEngine::textMargins (const QFont &font, const QString &, int &left, int &right, int &top, int &bottom) const [virtual] Return margins around the texts Parameters: font Font of the text left Return 0 right Return 0 top Return value for the top margin bottom Return value for the bottom margin Implements QwtTextEngine. QSize QwtPlainTextEngine::textSize (const QFont &font, intflags, const QString &text) const [virtual] Returns the size, that is needed to render text Parameters: font Font of the text flags Bitwise OR of the flags used like in QPainter::drawText text Text to be rendered Returns: Caluclated size Implements QwtTextEngine. Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtPlainTextEngine(3)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy