-1

I am attempting to send an e-mail to a recipient and bcc two other address using th e mail command. The issue is that the "-b " flag is not being read as such leading mail to try sending an e-mail to " -b someone@example.com ". The command is shown below.

mail -s "Test" person1@example.com -b person2@example.com </dev/null
Chris
  • 1
  • 1
  • What works and what doesn't depends on the precise version of `mail`. Please [edit] your question to provide more details about your `mail` (or `mailx`? The question says `mail` but you tagged it [tag:mailx]) package version and ideally some identifying characteristics from its local `man` page. For an overview of exactly how messy this is, see https://stackoverflow.com/a/48588035/874188 – tripleee Aug 02 '18 at 17:10
  • If this is accurate, you have Heirloom `mailx`: https://src.fedoraproject.org/rpms/mailx – tripleee Aug 02 '18 at 17:16

1 Answers1

0

Traditional Unix tools generally prefer their options before any non-option arguments, not mixed freely as some other conventions allow.

mail -s "Test" -b person2@example.com person1@example.com</dev/null

The SYNOPSIS section of the man page spells this out.

tripleee
  • 175,061
  • 34
  • 275
  • 318