LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bold the word (http://www.linuxquestions.org/questions/linux-newbie-8/bold-the-word-821388/)

elainelaw 07-21-2010 10:29 PM

bold the word
 
I have a script to output the result ( eg. echo $x ) , then send result to my Lotus mail server , can advise if I want to bold the words in the mail , what can i do ? thx

foodown 07-22-2010 12:14 AM

With plain vanilla email, there is no bold. It's just plain ASCII text like you see in vi or notepad.

However, almost all email readers seamlessly interpret HTML, so put HTML tags in the message, and you can bold, italic, set fonts, or even blink.

MTK358 07-22-2010 07:25 AM

If, as stated above, you want to implement bold text via HTML, use this:

Code:

echo "<b>$x</b>"
You should also make sure that the contents of $x do not contain HTML control characters that could mess up the document. This piece of Perl code will make any string display verbatim in an HTML document instead of tags trying to be interpreted:

Code:

#!/usr/bin/env perl
use warnings;
use strict;

my %substitutions = (
        '<' => '&lt;',
        '>' => '&gt;',
        '&' => '&amp;',
);

while (read STDIN, $_, 1) {
    if (exists $substitutions{$_}) {
                print $substitutions{$_};
        } else {
                print;
        }
}



All times are GMT -5. The time now is 04:31 AM.