<p dir="ltr">There's probably a better solution to this problem. But you could get by with this:</p>
<p dir="ltr">NEWMSG=`echo "$BBALPHAMSG" | sed 's/<!--[^>]*>//'`<br>
MSG="$FROM\n$TO\n$SUBJECT\n\n\n\n$NEWMSG\n"</p>
<p dir="ltr">J<br>
</p>
<div class="gmail_quote">On 02/10/2014 1:24 AM, "usa ims via Xymon" <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
<br><br>---------- Forwarded message ----------<br>From: usa ims <<a href="mailto:usaims@yahoo.com">usaims@yahoo.com</a>><br>To: <a href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>Cc: <br>Date: Wed, 1 Oct 2014 08:19:03 -0700<br>Subject: removing <!-- [flags:ordAstLe] > from custom email script<br>Hi,<br>
<br>
My boss didn't like the subject line of the default email alerts and he asked me to change it.<br>
<br>
I found a script online that does it -- so I modified the script and the subject line is doing what is expected but the body of the email is displaying some text that I would like not to be displayed.<br>
<br>
How can I remove the " red [965282] red <!-- [flags:ordAstLe] >" or more importantly "<!-- [flags:ordAstLe] >"?<br>
<br>
Here is the script:<br>
<br>
#!/bin/bash<br>
<br>
SM="/usr/sbin/sendmail"<br>
DATE=`date +%Y%m%d-%H%M%S`<br>
FROM="From: Xymon Server <<a href="mailto:xxxxxx@xxxxxx.com">xxxxxx@xxxxxx.com</a>>"<br>
TO="<a href="mailto:To%3Axxxxx@txxxxxx.com">To:xxxxx@txxxxxx.com</a>"<br>
<br>
     if [ "$RECOVERED" = "1" ]; then<br>
     RECOVERED="(Recovered)"<br>
     else<br>
     RECOVERED=""<br>
     fi<br>
<br>
SUBJECT="Subject: D0 BIG BROTHER ALERT - $BBSVCNAME test on $BBHOSTNAME"<br>
<br>
<br>
MSG="$FROM\n$TO\n$SUBJECT\n\n\n\n$BBALPHAMSG\n"<br>
<br>
<br>
echo -e "$MSG" | $SM -t<br>
#####################################################<br>
<br>
On a 'conn' test, it is displaying:<br>
<br>
xxxxxxx.corp.local:conn red [965282] red <!-- [flags:ordAstLe] --> Wed Oct  1 10:46:24 2014 conn NOT ok<br>
<br>
Service conn on xxxxxxx.corp.local is not OK : Host does not respond to ping<br>
<br>
<br>
System unreachable for 20 poll periods (5386 seconds)<br>
<br>
&red 5.5.5.5 is unreachable<br>
<br>
###################################################<br>
<br>
Is there anyway to remove that? Thanks in advance.<br>
<br>
usaims<br>
<br>
<br>
<br>
<br>
<br>
<br></blockquote></div>