简体   繁体   English

使用uuencode,如何重命名发送时附加的文件?

[英]Using uuencode, how to rename the file being attached while sending?

I am using uuencode as below 我正在使用uuencode如下

uuencode /root/some/directory/**Test.txt** /root/some/directory/**Test.txt** | mail -s 'test' xyz@mail.com

The above command is working as expected but while the mail comes to the inbox of xyz@mail.com the file name changes to rootsomedirectoryTest.txt but the actual file name is Test.txt 上面的命令按预期工作,但是当邮件到达xyz@mail.com的收件箱时,文件名更改为rootsomedirectoryTest.txt,但实际文件名是Test.txt

Filename remains same when i trigger this command from the directory where the file is. 当我从文件所在的目录触发此命令时,文件名保持不变。 above command adds path to the file name, but i need the orignal file name to be sent. 上面的命令将路径添加到文件名,但是我需要发送原始文件名。

Could someone help please? 有人可以帮忙吗?

只需使用

uencode /root/some/directory/Test.txt Test.txt | mail -s 'test' xyz@mail.com

Do the work in the directory where the file lives, and don't specify the full pathame: 在文件所在的目录中进行工作,并且不要指定完整路径:

cd /root/some/directory
uuencode Test.txt Test.txt | mail -s 'test' xyz@mail.com

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

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