maildirwatch — wait for changes to a maildir
maildirwatch
{maildir
} {command
} [argument
...]
maildirwatch repeatedly invokes the
command
, with any optional
argument
s, an external
command, as follows:
The first time the
command
gets executed
is immediately after
maildirwatch starts.
Subsequent invocatons of
command
occur whenever
there may be some kind of a change
to the contents of the
.
maildir
maildirwatch does not determine what, if anything,
changed in the
.
maildirwatch
might
occasionally raise a false alarm and run the
maildir
command
even though
nothing changed, but that's rare. It's also possible that by
the time command
actually runs, then whatever was changed in the
is no longer
changed; it became what it was before it was changed (a mystery
that will remain unsolved forever).
It's up to the
maildir
command
to
intelligently figure out
if it needs to do something about whatever it finds in the
.
maildir
maildirwatch is a rudimentary mechanism for writing shell scripts that deal with newly-delivered mail, in some form or fashion.