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

问题描述

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

#!/bin/csh
mutt -e "set content_type=text/html" -s "status report on" rama@abc.com < mail1.html

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

#!/bin/csh
mutt -e "set content_type=text/html" -s "status report on" -a "sum.csv" rama@abc.com < mail1.html

Can't stat rama@abc.com: No such file or directory
rama@abc.com: 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.

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...