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

Linux:为什么在使用uuencode时从文件名中删除冒号(:)?,linux,email,uuencode,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_wit

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

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
我怎样才能修好它


谢谢

您可以尝试将uuencode与“-encode file name”一起使用。然而,在这里,我看到:

$ 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偏见可能会使电子邮件客户端放弃冒号。

有许多不同的
邮件
实现,这是哪一种?@mata不知道。我怎么知道呢?这取决于您的linux发行版,请检查您的软件包管理器安装了哪些与邮件相关的软件包…:也是经典Mac OS上的目录分隔符。它可能会被剥离,因为它在文件名中通常被认为是不可移植的。这是有道理的——只禁止文件名中必须禁止的内容的想法是非常Unixy(Linux,OS X)-“/”和NUL。