我需要编写一个Unix shell脚本来发送邮件。
以下脚本允许我使用可变的消息正文。
在下面的代码中,是否可能有一个可变的主题部分?
#!/bin/bash
# Sending mail to remote user
sender="root@sped56.lss.emc.com"
receiver="root@sped56.lss.emc.com"
body="THIS IS THE BODY"
subj="THIS IS THE SUBJECT."
echo $body | mail $receiver -s "THIS IS THE SUBJECT" // this works fine
echo $body | mail $receiver -s $subj // ERROR - sends one mail with only
//"THIS" as subject and generates another error mail for the other three words