#!/bin/bash mailQueueCount=`/usr/bin/qmHandle -s | grep 'Total messages: ' | grep -oE '[0-9]{1,}'` echo $mailQueueCount