while true; do echo Enter month read MONTH case $MONTH in ...ok...) break;; *) echo Invalid month name, try again >&2 ;; esac done grep $5 "$MONTH" tempfile >tempmonth