问题描述
大家好,
我的Shell脚本有一个难点。我想在Solaris服务器上使用mail或mailx和uuencode实用程序发送四个文本文件和一个csv文件作为附件。
它是Sun Microsystems SunOS 5.10
这是我的代码
Hi All,
I have one difficulty here with my Shell script. I want to send four text files and one csv file as attachment using mail or mailx and uuencode utility on Solaris server.
It is Sun Microsystems SunOS 5.10
Here is my code
( uuencode "file1.txt" "file1.txt" ; "file2.txt" "file2.txt" ; "file3.txt" "file3.txt" ; "file4.txt" "file4.txt" ; "file5.txt" "file5.txt" ) | mailx -s "Subject" [email protected] < ~/maiBodytext.txt
现在的问题是,mailx正在发送邮件但没有任何附件。
我尝试了很多,也用google搜索。但找不到解决方案。
是否我们无法从SunO发送附件,因为我也尝试发送单个附件,但它失败了。
请注意,脚本和文件位于同一位置,即我的主目录。
此外,此脚本适用于具有相同版本的其他Solaris盒作为SunOs 5.10,但它来自Oracle公司。供应商规范是否重要。据我所知,甲骨文已经接管了Sun长期以来,为什么会有这种差异。
请帮帮我。
提前致谢!
Now the problem is, mailx is sending a mail but without any attachment.
I tried lot and googled too. But could not find the solution.
Is it the case that we cannot send attachment from SunOs cause i tried sending single attachment too, it failed.
Please note, both the script and the files are under same location i.e. my home directory.
Also, this script works on other Solaris box which has same version as SunOs 5.10 but it is from Oracle Corp. Does vendor specification matters. As far as i know, Oracle has took over Sun long back, then why there is this difference.
Please help me with this.
Thanks in advance!
推荐答案
cat file1.txt file2.txt | uuencode | mailx -s "Subject" [email protected] < ~/mailBodytext.txt
参见:
[]
[]
( cat mailBody.txt; uuencode "abc.txt" "abc.txt"; uuencode "xyz.txt" "xyz.txt"; uuencode abc.csv abc.csv ) | mailx -s "attach test" [email protected]
这篇关于在Sun Solaris上通过mailx分配附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!