So trying to write a bash script that uses mutt to send various emails. So the following works with no attachment:
cat $email_body | /usr/bin/mutt -s "$msg_subject" $rcpt
However when I try to attach a file I see the following:
cat $email_body | /usr/bin/mutt -s "$msg_subject" -a "$file_to_attach" $rcpt
Can't stat
Adding “–” before the recipient’s email address works:
cat $email_body | /usr/bin/mutt -s "$msg_subject" -a "$file_to_attach" -- $rcpt