I have read through all documents in FAQ and have run into an issue with sending an email with body message text and an email attachment. I have included what I have thus far and I can get the message body to send in the email to work only. I cannot understand the uuencode even after I read the man pages on it. I am using ksh and it seems a bit strange to me why I cannot get this simple task to work. Please help. I can't get past file not found error. Also can someone explain to me in the following:
uuencode [-m] [infile] remote
what remote means exactly. because I just want to uuencode a file that I have on the server that I am working on. It is the only server I know of. And it took a lot of trial and error to figure out the proper sytax to creat the mailx statement because of the <<-EOF put message here (new line)EOF
Thanks for any help you can provide.
#!usr/bin/ksh -p
base= '/usr/local/ol_inv/daily_ETL/test/';
base1= '/usr/local/ol_inv/daily_ETL/test/testfile.txt';
base2= '/usr/local/ol_inv/daily_ETL/test/msgfile.txt';
base3= '/usr/local/ol_inv/daily_ETL/test/combofile.txt';
print "we are sending the message...";
# uuencode ${base}testfile.txt emailattachr2.txt | cat ${base}testfile.txt ${base}msgfile.txt > ${base}combofile.txt
uuencode testfile.txt emailattacher2.txt | cat testfile.txt msgfile.txt > combofile.txt
mailx -s "Online Financial Reporting - New Users" -r "Tim Kline"
tim.kline@company.com <<-EOF
~<${base3}
EOF
echo "email was sent!";
>>>command typed at prompt<<<<
$ ksh mail2_ksh.ksh
>>>resulting output<<<<<<<
mail2_ksh.ksh[4]: /usr/local/ol_inv/daily_ETL/test/: 0403-006 Execute permission denied.
/usr/local/ol_inv/daily_ETL/test/testfile.txt: This: not found.
/usr/local/ol_inv/daily_ETL/test/msgfile.txt: This: not found.
/usr/local/ol_inv/daily_ETL/test/combofile.txt: This: not found.
/usr/local/ol_inv/daily_ETL/test/combofile.txt[3]: This: not found.
we are sending the message...
Interpolate what file?
email was sent!
>>>actaul file paths and permissions<<<
$ pwd
/usr/local/ol_inv/daily_ETL/test
$ ls -l
-rwxr--r-- 1 ol_inv whs 1 Jun 28 14:02 attach.txt
-rwxr--r-- 1 ol_inv whs 312 Jun 28 15:40 combofile.txt
-rwxr--r-- 1 ol_inv whs 884 Jun 28 15:40 mail2_ksh.ksh
-rwxrw-r-- 1 ol_inv whs 208 Jun 28 13:53 msgfile.txt
-rwxrwxrwx 1 ol_inv whs 104 Jun 28 13:56 testfile.txt