Reputation: 27
echo test=$( "Message Body " | mail -s "Subject Testing " -a $(ls -dt $PWD/*|head -1) [email protected])
Upvotes: -3
Views: 783
Reputation: 36
I am not sure if I get you right. You want to mail with an attachment and a body, and set $test variable the message? Why don't just set it explicitly.
Or you just wanna know how to add the message body to the mail? If so, it would be like this.
mail -A hello.txt -s "Subject Test" [email protected] <<< "This is the message"
Use -A for debian based systems, which uses mailutils package.
Upvotes: 0