简体   繁体   English

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

[英]Linux: why colon (:) is removed from the file name when using uuencode?

I am trying to e-mail a file containing colon (:) character in the name: 我正在尝试通过电子邮件发送名称中包含冒号(:)字符的文件:

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

But, when I receive the e-mail, I see ":" has been removed from the file name. 但是,当我收到电子邮件时,我看到“:”已从文件名中删除。

some_file_with__in_the_name.txt

How can I fixed it? 我该如何解决?

Thanks. 谢谢。

You might try using uuencode with "--encode-file-name". 您可以尝试将uuencode与“ --encode-file-name”一起使用。 However, here, I'm seeing: 但是,在这里,我看到了:

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

which is exactly what I'd want in the "begin" line. 这正是我在“开始”行中想要的。

In contrast: 相反:

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

uudecode doesn't require any options to be able to reconstruct foo:bar.txt from Zm9vOmJhci50eHQ= on my computer. uudecode不需要任何选项就可以从计算机上的Zm9vOmJhci50eHQ =重构foo:bar.txt。

Check the raw content of your email too, it's possible the email client is being stupid. 还要检查您电子邮件的原始内容,这可能是电子邮件客户端很愚蠢。 A DOS bias, for example, could make an email client ditch colons. 例如,DOS偏见可能会使电子邮件客户端冒号冒号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM