attachment with mailx sometimes result in data confusion [not reproducable]

Hi

Ich have a script with SQL*Plus what sends a *.csv to serveral people using M$ Outlook.

$ grep mailx report.sh
(cat /opt/tmp/MSG.txt ; uuencode $data_report report.csv ) | mailx -s "Report" -r xx@xxx.com yyy@yyy.com zzzz@zzzzz.org

On a Solaris box:

$ uname -a
SunOS hostname 5.10 Generic_139555-08 sun4v sparc SUNW,Sun-Blade-T6320

Sometimes in resulting mail there is a data confusion. See screenshot.

Sometimes there is attached a *.csv, like designed. Why? Howto fix?
When customer complains about data garbage, I rerun the script and everything ok..

Are you absolutely CERTAIN that your input files to uuencode never get overwritten while your mail script is running?

1 Like

Can you please explain me in simple language the technical reason for you input?

Maybe you are right. Bevore sending mail I have this in my script:

rotate_output  ()
{
cp /opt/path/output /opt/path/archive/output.$(/bin/date '+%m')
}

I removed the lines and rerun script about 20 times without error in mail.