/usr/local/bin/getmailq.sh
#!/bin/bash QUEUES="incoming active deferred hold" for i in $QUEUES; do COUNT=`qshape $i | grep TOTAL | awk '{print $2}'` result="${result} $i:$COUNT " done echo $result