Question

I am using uuencode as below

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

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?

Was it helpful?

Solution

Just use

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

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top