i want to tail log file with grep and sent it via mail like:
tail -f /var/log/foo.log | grep error | mail -s subject name@example.com
how can i do this?