Why is the "mail" command's option "-s" not working?

1

when I use

mail root -s "subject" <~/.bashrc 

it doesn't work. It just prompts me to input the subject as if I used mail root. After I keyed in the content, ended it up with ' .' or Ctrl+D, it seems to recognize the -s, and so it reads

send-mail "invalid options --'s'

and things like that.

betterYoung

Posted 2014-11-22T07:26:38.510

Reputation: 11

Answers

0

There can be multiple programs behind the mail command on linux, but they should generally accept the -s options. However, the ones I tested require the email addressee to come after the options. Try this command instead:

mail -s 'subject' root < ~/.bashrc

This syntax has always worked for me.

AtomHeartFather

Posted 2014-11-22T07:26:38.510

Reputation: 236