I have a zip file named : zip_final.zip
I have to attach this file as a attachment and send the mail.
Also, I have to display all the file_names present inside the zip file in the mail body.
I have this code :
export files_list=`unzip -Zl zip_final.zip`
mailx -a ${zip_final.zip} -s "Files list | Zip file" << EOM
Hi team, sent zip file.
Files inside it are : $files_list
Thank you.
EOM
But the mail is not sent if I am doing this. Like the mail command is not even getting called/triggered. I am not even getting any error messages too.
Can someone suggest how to send that zipfile as an attachment using mailx command and also display all the file names inside the zipfile in the mail body?