Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-22-2011
Banned
 
Join Date: Mar 2008
Posts: 143
Thanks: 0
Thanked 0 Times in 0 Posts
MySQL Junk characters in mailx output

I have script which send a mail with top output. The script look like
$ cat health.sh
#!/bin/sh
maillist="email address"
rm /home/rtq1/file
top -n 1 | head 15 > file
cat file | mailx -s "Daily Health Report from `hostname` ..." "${maillist}"

But now i am getting some junk characters along with the output in mail. If I open file in vi, it is showing with junk characters

^[[H^[[2J^[[m^[(Btop - 02:27:57 up 24 days, 3:16, 1 user, load average: 0.31, 0.33, 0.28^[[m^[(B^[[39;49m^[[K
Tasks:^[[m^[(B^[[39;49m^[[m^[(B 142 ^[[m^[(B^[[39;49mtotal,^[[m^[(B^[[39;49m^[[m^[(B 1 ^[[m^[(B^[[39;49mrunning,^[[m^[(B^[[39;49m^[[m^[(B 139 ^[[m^[(B^[[39;49msleeping,^[[m^[(B^[[39;49m^[[m^[(B 2 ^[[m^[(B^[[39;49mstopped,^[[m^[(B^[[39;49m^[[m^[(B 0 ^[[m^[(B^[[39;49mzombie^[[m^[(B^[[39;49m^[[K


I have tried this also
top -n 1 | mailx -s "Daily Health Report - `hostname` ..." "${maillist}"

But no luck

Please help me to sort out this

Regards,
Renjesh Raju
Sponsored Links
    #2  
Old 11-22-2011
Scott's Avatar
Scott Scott is online now Forum Staff  
Administrator
 
Join Date: Jun 2009
Location: Zürich
Posts: 6,851
Thanks: 212
Thanked 745 Times in 651 Posts
13 - unlucky for some

You have had 12 reminders and / or infractions, and still you can't use simple code tags.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mailx Emails are going to Junk, How to stop them? karumudi7 Shell Programming and Scripting 3 09-07-2011 05:40 AM
Handling Junk Characters help_scr_seeker Shell Programming and Scripting 3 07-06-2011 11:22 AM
Replacing junk characters ashwin3086 Shell Programming and Scripting 16 07-13-2010 11:35 AM
finding junk characters ashwin3086 Shell Programming and Scripting 20 06-30-2010 09:16 AM
junk characters in ls -l output in solaris10 ragtechy Solaris 7 04-07-2009 08:09 AM



All times are GMT -4. The time now is 11:37 AM.