Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I guess I'm looking for how to make a script to run whenever you press ENTER in bash, so that it can alert you by echoing a line about some event if an event has occurred.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

You can use the special PROMPT_COMMAND variable, look it up in man bash.

$ PROMPT_COMMAND='echo hello'
hello
$ 
hello
$ 

Set it at the end of ~/.bashrc. I suggest you write a function and call that function in the PROMPT_COMMAND.

share|improve this answer
add comment

There have been tools to do this for ages, starting with the venerable 'biff'. Gnubiff looks like the most capable (it does IMAP and POP3) option in ubuntu:

http://packages.ubuntu.com/natty/gnubiff

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.