confuseddddd
Programmer
Hello,
Have created a script that is to attach a text file into an email but don't think I have it coded correctly:
#!/bin/ksh
scp username@abc.com:/directory_where_file_is /tmp
if [ -e /tmp/filename.txt ];
then
uuencode /tmp/filename.txt attached_filename.txt | mail -s "Your file is attached" someone@somewhere.com
else
mail -s "Caution !! file was not available to send" username@abc.com
fi
I also tried to use cat as well but this put the contents of the file into the email and I am going to have large files so this won't work either.
cat $TRANSLOG | sendmail -f run.newtran@servername.com "someone@somewhere.com"
Any help would be great.
Thanks
Have created a script that is to attach a text file into an email but don't think I have it coded correctly:
#!/bin/ksh
scp username@abc.com:/directory_where_file_is /tmp
if [ -e /tmp/filename.txt ];
then
uuencode /tmp/filename.txt attached_filename.txt | mail -s "Your file is attached" someone@somewhere.com
else
mail -s "Caution !! file was not available to send" username@abc.com
fi
I also tried to use cat as well but this put the contents of the file into the email and I am going to have large files so this won't work either.
cat $TRANSLOG | sendmail -f run.newtran@servername.com "someone@somewhere.com"
Any help would be great.
Thanks