Skip to content

bash equivalent of MAILCHECK and MAILPATH (checking for mail in /var/mail) #9937

Closed Answered by faho
valankar asked this question in Q&A
Discussion options

You must be logged in to vote

Or build it yourself:

function checkmail --on-event fish_prompt
    if set -q mailtime
        set -l newtime (path mtime $MAILPATH)
        if test $newtime -gt $mailtime
            echo NEW MAIL
            set -g mailtime $newtime
        end
    else
        set -g mailtime (path mtime $MAILPATH)
    end
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@faho
Comment options

Answer selected by faho
@koozz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants