Please help me with this problem.
I have a number of split files in a directory. each split files has pdf filenames in it. pdf files are also in the same directory.
I send a mail for each split files present in the directory with the pdf file mentioned in the file.
I have written a code which i have mentioned below.
it works fine but attachment is missing. please let me know where i went wrong.
cd /home/oracle
. ./oas1012.env
cd /home/oracle/PO_REP
for list in `ls split_*`
do
typeset str="";
echo $list
( cat $list | while read file
do
if [ -n "${str}" ];
then
str="$str; uuencode $file";
else
str="uuencode $file";
fi
done
echo $str
( eval ${str} ) | mailx -s"Mailx" balaji_devadoss@syntelinc.com <<-EOF
EOF
echo "mailled"
)
echo "....................................."
done
echo "======End Mailling Suppliers======" >>${logfile}
exit 0
I read the post, But in my case if i remove
<<-EOF
EOF
at the end of mailx command, i am able to get mails with attachments.
But the problem is i have press CTRL+D everytime for the mail to get delivered.
if i remove EOF, for each iteration in for loop its struck and i have to press CTRL+D everytime which i dont want to do since its a batch process.
Moreover if i remove EOF i am not getting any mails. thats the problem.
---------- Post updated at 04:33 AM ---------- Previous update was at 01:22 AM ----------