0

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?

Roberto Reale
  • 4,247
  • 1
  • 17
  • 21
Randeep Singh
  • 91
  • 1
  • 2
  • 11

2 Answers2

3

Just use

uencode /root/some/directory/Test.txt Test.txt | mail -s 'test' xyz@mail.com
Roberto Reale
  • 4,247
  • 1
  • 17
  • 21
2

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
RichieHindle
  • 272,464
  • 47
  • 358
  • 399