for i in /aceapp/QATD011R4/ace.ofac/testofac/results/
do
uuencode ${i} ${i%.*}.txt
done > attach.out
mail -s "Summary Report" smawle@acesw.com < attach.out
If the files are in binary format or if they are encrypted, you can see them in binary...
for example, if you have the extension of a pdf or doc file to txt and try to open it using notepad, you cannot read the text
I am trying below code for attached multiple % summary % csv files in email. However, not able to attached it. Also, we only required Summary files in particular folder.
eg. In result folder 100 csv file we need to fetched only summary file. ( SDN_WCFINCEN_summary_20151013_111216.csv )
So, that in code we had mentioned that %summary%.csv
Below are code we are using.
(cat /aceapp/QATD011R4/ace.ofac/testofac/results/%summary*.*;uuencode /aceapp/QATD011R4/ace.ofac/testofac/results/summary*.* %summary*.*) | mail -s "Summary Report" smawle@acesw.com
There are no percent sign characters in the pathname SDN_WCFINCEN_summary_20151013_111216.csv and percent sign characters in a pathname pattern matching expression match literal percent sign characters. It would seem that you want to use something more like:
which will give you plain text and unencoded text in the body of the mail. But, it will only work if there is one and only one file in that directory that contains the string summary and ends with the string .csv .