Linux:为什么在使用uuencode时从文件名中删除冒号(:)?

时间:2015-08-11 06:02:42

标签: linux email uuencode

我正在尝试通过电子邮件发送名称中包含冒号(:)字符的文件:

my_attachment_name=some_file_with_:_in_the_name.txt
uuencode "${my_attachment_name}" "`basename \"${my_attachment_name}\"`"
     | mail -s "My Report ..." my_email@xyz.com

但是,当我收到电子邮件时,我看到":"已从文件名中删除。

some_file_with__in_the_name.txt

我该如何解决?

感谢。

1 个答案:

答案 0 :(得分:0)

您可以尝试在" - encode-file-name"中使用uuencode。但是,在这里,我看到了:

$ uuencode foo:bar.txt foo:bar.txt
begin 664 foo:bar.txt
#:&D*
`
end

这正是我在"开始"中所需要的。线。

相反:

$ uuencode --encode-file-name foo:bar.txt foo:bar.txt
begin-encoded 664 Zm9vOmJhci50eHQ=
#:&D*
`
end

uudecode不需要任何选项来从我的计算机上的Zm9vOmJhci50eHQ =重建foo:bar.txt。

检查电子邮件的原始内容,电子邮件客户端可能是愚蠢的。例如,DOS偏见可能会使电子邮件客户端冒出冒号。