While looking for a script to check domain availability I came across this one
clear; echo Checking domains
for var in "$@"
tput sc; tput cup 0 0; echo ' '
tput cup 0 0; echo Checking $var
whois $var.org.uk | grep "No match"
whois $var.co.uk | grep "No match"
if [ $i == 2 ]; then
tput sc; tput cup 0 25; echo 'Waiting politely...'
tput cup 0 25; echo ' '
What i'd like to be able to do is if it returns
No match for "$var.co.uk" that it will send me an email ie
if status = no match then sendEmail