如何使用 C shell 在 mutt 命令中附加 csv

问题描述

以下是我在不附加 csv 文件的情况下尝试使用 html body 的代码。它工作正常

#!/bin/csh
mutt -e "set content_type=text/html" -s "status report on" [email protected] < mail1.html

以下是我在尝试附加 csv 文件时尝试的代码。但它无法正常工作并出现如下所示的错误

#!/bin/csh
mutt -e "set content_type=text/html" -s "status report on" -a "sum.csv" [email protected] < mail1.html

Can't stat [email protected]: No such file or directory
[email protected]: unable to attach file.

我可以知道上面的代码出了什么问题吗??

解决方法

如果您希望收件人在附件之后,则必须添加 -- 作为分隔符。

查看 mutt 的手册页:

 -a file [...]
        Attach  a  file  to  your  message  using MIME.  
        When attaching single or multiple files,separating filenames and recipient
        addresses with "--" is mandatory,e.g. mutt -a image.jpg -- addr1
        or mutt -a img.jpg *.png -- addr1 addr2.   The  -a  option
        must be placed at the end of command line options.