Pipe report-ready as the body and send it to ops@example.test with subject Daily report.
Which command is appropriate?
mail -s SUBJECT RECIPIENT reads the body from standard input and sets the subject with -s.
Detailed explanation
printf '%s
' report-ready | mail -s 'Daily report' ops@example.testCorrect. It sets the subject and pipes the body to mail.
Correct. It sets the subject and pipes the body to mail.
mailq -s 'Daily report' ops@example.testIncorrect. mailq only displays the queue.
Incorrect. mailq only displays the queue.
newaliases -s 'Daily report' ops@example.testIncorrect. newaliases rebuilds aliases.
Incorrect. newaliases rebuilds aliases.
mail -q 'Daily report' ops@example.testIncorrect. -q is not the subject option and no body is supplied.
Incorrect. -q is not the subject option and no body is supplied.
Try it yourself
An example you can run in a temporary verification environment.
mail --help 2>&1 | grep -E -- '-s|subject' | head -n 1Expected result
subjectを指定するhelp行Key points
- -s is subject
- Standard input is the body
- The MTA handles delivery
Notes
- Environment: mail help / メール送信なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.