bolding output of a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bolding output of a script
# 1  
Old 08-11-2006
bolding output of a script

does anyone know what i can add to my script to bold certain characters?

i run a script that outputs things to a file and then sends it to outlook. these "things" are separated by asterisks. i want to bold these asterisks so they are more distinctive.


example:
echo "****************************************"
echo "****************************************"


how can i make those asterisks bold when they are sent to outlook?
Terrible
# 2  
Old 08-11-2006
You can try this, provided that your terminal can correctly use the escape sequences.

Code:
#! /usr/bin/ksh
TERM_BLACK='\033[30m'
TERM_RED='\033[31m'
TERM_GREEN='\033[32m'
TERM_YELLOW='\033[33m'
TERM_altBLUE='\033[34m'
TERM_BLUE='\033[3;34m'
TERM_MAGENTA='\033[35m'
TERM_CYAN='\033[36m'
TERM_WHITE='\033[37m'

TERM_RESET='\033[0;0m'
TERM_BOLD='\033[1m'
TERM_REVERSE='\033[2m'

TERM_BLACKBG='\033[40m'
TERM_REDBG='\033[41m'
TERM_GREENBG='\033[42m'
TERM_YELLOWBG='\033[43m'
TERM_BLUEBG='\033[44m'
TERM_MAGENTABG='\033[45m'
TERM_CYANBG='\033[46m'
TERM_WHITEBG='\033[47m'

TERM_TITLE_BEGIN='\033]2;'
TERM_TITLE_END='\007'

print "${TERM_BOLD}Hello${TERM_RESET} there!"

This will work for terminal output. Outlook is a different animal. If you want it to show up bold using HTML tags (<b> and </b>), then you can easily do that but if MS Word is your email editor, good luck, that's alot more difficult.
# 3  
Old 08-11-2006
Quote:
Originally Posted by tmarikle
You can try this, provided that your terminal can correctly use the escape sequences.

Code:
#! /usr/bin/ksh
TERM_BLACK='\033[30m'
TERM_RED='\033[31m'
TERM_GREEN='\033[32m'
TERM_YELLOW='\033[33m'
TERM_altBLUE='\033[34m'
TERM_BLUE='\033[3;34m'
TERM_MAGENTA='\033[35m'
TERM_CYAN='\033[36m'
TERM_WHITE='\033[37m'

TERM_RESET='\033[0;0m'
TERM_BOLD='\033[1m'
TERM_REVERSE='\033[2m'

TERM_BLACKBG='\033[40m'
TERM_REDBG='\033[41m'
TERM_GREENBG='\033[42m'
TERM_YELLOWBG='\033[43m'
TERM_BLUEBG='\033[44m'
TERM_MAGENTABG='\033[45m'
TERM_CYANBG='\033[46m'
TERM_WHITEBG='\033[47m'

TERM_TITLE_BEGIN='\033]2;'
TERM_TITLE_END='\007'

print "${TERM_BOLD}Hello${TERM_RESET} there!"

This will work for terminal output. Outlook is a different animal. If you want it to show up bold using HTML tags (<b> and </b>), then you can easily do that but if MS Word is your email editor, good luck, that's alot more difficult.

thanks a million for your input.

see, i dont care about the terminal out put. all i really care about is how it would look in outlook since that is the destination.

if you can, can you please just give me a simple code on how to do this in html. something very simple. just for those two echo asterishks lines. i'll figure out the rest myself.
Terrible
# 4  
Old 08-11-2006
Here is a link on how to do this using sendmail.

In case the link breaks at some future point, the jist of it is as follows:
Code:
#!/usr/bin/posix/sh

(
cat <<!
MIME-Version: 1.1
From:from@xxxxxxxxxxxxxx
To: to@xxxxxxxxxxxx
Subject: This is the subject of the mail. Date: $(date)
Content-Type: multipart/mixed; boundary="_boundarystring"

This is a multi-part message in MIME format.
--_boundarystring
Content-Type: text/html
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Base: "http://somewebsite.com/";

<html>
<body><font size=4>This</font> is a <i>test</i>.<br>
text line1<br>
<FONT FACE="Courier New">
12345678901234567890<br>
text line2<br>
</FONT>
</body>
</html>

--_boundarystring--
!
) | /usr/lib/sendmail -t -n -v

# 5  
Old 08-11-2006
thanks a million
Terrible
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script to call and sort awk script and output

I'm trying to create a shell script that takes a awk script that I wrote and a filename as an argument. I was able to get that done but I'm having trouble figuring out how to keep the header of the output at the top but sort the rest of the rows alphabetically. This is what I have now but it is... (1 Reply)
Discussion started by: Eric7giants
1 Replies

2. Shell Programming and Scripting

A shell script to run a script which don't get terminated and send a pattern from the output by mail

Hi Guys, I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

3. Shell Programming and Scripting

Shell Script function to use script name for log file output

Hi Team - I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n? %~n is a DOS variable that dispayed the script name. For instance (in DOS): REM... (11 Replies)
Discussion started by: SIMMS7400
11 Replies

4. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

5. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

6. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

7. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

8. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

9. Red Hat

Cron task output is 0, script output is OK

I have the following cron task set to run every 15 minutes to ascertain how many users are in the system and append the result to the log. /home/pronto/cus/whoisinc >> /home/pronto/cus/whoisin.log This is the whoisinc script date +"%d-%m-%Y,%k:%M,Pronto Users,`prowho -s | grep -v... (1 Reply)
Discussion started by: scottm
1 Replies

10. Shell Programming and Scripting

Running a script in system() call and want the script's output

Hi All, I have a script(sample.sh) displaying the output of "dd" command. Now i am using this script in system() call as, system("sh sample.sh") in an application file. I want the output of system("sh sample.sh") in the application file itself. How can i get it? Many thnaks.... (9 Replies)
Discussion started by: amio
9 Replies
Login or Register to Ask a Question