BT Group Interview Question

How to do a unix scripting to mail when rows are rejected by sql loader ?