#!/bin/sh # checkmail.sh until [ 1 -eq 2 ]; do `cat /var/spool/mail/muskrat | grep command | awk '{print $3}'` sleep 2 done