我有一点bashscript:
mail_body_file="mailbody.txt"
for fullname in *.zip; do
filename="${fullname%.*}"
mutt -a $fullname -s "Attachment $fullname" xxx@xxx.com < $mail_body_file
我有两个问题;
谢谢
答案 0 :(得分:1)
要将变量$filename
的内容写入mailbody.txt
,例如第5行,您可以这样做:
sed '5i\'$filename mailbody.txt > output.txt
mv output.txt mailbody.txt