Sample Header Ad - 728x90

send multiple files as mail though mailx command

0 votes
1 answer
2662 views
I have 3 file names present inside a .txt file I have to read all file names and send them as a attachment in a mail. Example: test.txt - (file name) -query1.dat -query2.dat -query3.dat I have to read test.txt file and get all those query*.dat files and send a mail with all those files as attachment using mailx command. I have this code:
while read line
do

    mailx -a ${line} -s "files" ${mail_from} << EOM

    Hi, Sent files

    EOM

done
It sends each file seperately in a seperate mail. I need to send all these files in a single mail. How to do that?
Asked by Venkatesha Prasad S (1 rep)
Jun 21, 2022, 10:58 AM
Last activity: Nov 15, 2023, 05:03 PM