1

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.

2 Answers 2

2

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .