Hi all,
I am trying to port some scripts that were writen in Tru64 over to Linux and when I try to execute an existing script that uses mailx to send a uuencoded attachment the attachment is missing from the received email.
Mailx takes in a command as standard input from a file and appends the standard output from the commands executed in that file and then mails it. On the alpha the commands work as you would expect however on the linux box the standard imput from the file is passed to mailx as a literal with the mail message being the contents of the input file.
eg mailx -s "why does this work on an alpha" foo@bar.edu.au < email_report_body.txt
The input file contains the following:
on the alpha
Hi, Report attached to this email
~<! /usr/bin/uuencode /usr/opt/sis/my_report my_report.xls
on the linux box*
Hi, Report attached to this email
~! /usr/bin/uuencode /usr/opt/sis/my_report my_report.xls
* the linux version of mail/mailx does not appear to like ~<! command to run a script or command but yet it is listed in the man page.
Is there something different with the RHEL implementation of mailx (which is a posix implementation of mail) or am I doing something wrong or stupid here?
I realise the command could be re-written, for example:
(cat email_report_body.txt ; uuencode my_report.txt my_report.xls) | mailx -s "This now works on RHEL" foo@bar.edu.au
......however this would be the last option chosen as obviously I would just like to port the code as is.
All suggestions greatly appreciated,
Regards