shopt-option

mailwarn shell option

Enables a notice when a monitored mailbox was accessed since its previous check. Depends on MAIL, MAILPATH and MAILCHECK in interactive shells. Fixture checks option state only; no real mail files accessed. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): enabled then disabled.

Formal Syntax & Structure

bash syntaxbash
shopt -s mailwarn; shopt -u mailwarn

Return Value

exit status

Setting or clearing an available option succeeds; a query returns zero when enabled and one when disabled.

Working Example

Example Snippetbash
shopt -s mailwarn || exit 1shopt -q mailwarn || exit 1shopt -u mailwarn || exit 1if shopt -q mailwarn; then exit 1; fiprintf "enabled then disabled\n"
Bash Reference