質問

i need to send a weekly email containing some dynamic information that will be collected in a txt file. what i can't accomplish is adding the content of that file into the subject of my email. my file is named bkp.txt and has one line "weekly backups; total: 10; size: 3gb"

is there any way i can send an email using this format

mailx -s "weekly backups; total: 10; size: 3gb" "email.address@domain.com" < another.txt, keeping in mind the content of bkp txt can modidy every week?

thanks!

役に立ちましたか?

解決

Use bash command substitution:

mailx -s "$(<bkp.txt)" ......
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top