Search code examples
linuxshellunixuuencode

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


I am using uuencode as below

uuencode /root/some/directory/**Test.txt** /root/some/directory/**Test.txt** | mail -s 'test' [email protected]

The above command is working as expected but while the mail comes to the inbox of [email protected] the file name changes to rootsomedirectoryTest.txt but the actual file name is 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?


Solution

  • Just use

    uencode /root/some/directory/Test.txt Test.txt | mail -s 'test' [email protected]