From Bash manual and https://unix.stackexchange.com/a/280557/674
'MAILPATH'
<p>A colon-separated list of filenames which the shell periodically checks for new mail . </p> <p>Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the filename from the message with a '?'. When used in the text of the message, '$_' expands to the name of the current mail file.</p>
Example:
$ MAILCHECK=1 MAILPATH='/tmp/a?New mail in <$_>' bash bash$ echo test >> /tmp/a New mail in </tmp/a>
"Mail" doesn't mean the same as emails or instant messages. What does "mail" mean?
Does the content of a mail file consist of one or more than one "mails"? If more than one, how are the mails separated from each other?
What event is considered as the arrival of a new mail?
Is "mail" a concept within a special application, the bash shell, or the OS? There doesn't need a special application for handling (sending and receiving) "mails". Rather the bash shell checks new "mails".
What can we use "mail" for?
- For communication between multiple users,
- for inter-processes communication like named pipes,
- for detecting changes to specific files (this is what I can tell from the example above)?
Thanks.
sendmail
for themail
command to work but it seems that you already have it running. You can use programs such asmutt
to open/tmp/a
mbox
:mutt -f /tmp/a
– Arkadiusz Drabczyk Aug 03 '17 at 16:37