USER= PASS=Your_Password COUNT=`curl -su $USER:$PASS https://mail.google.com/mail/feed/atom || echo "unknown number of"` COUNT=`echo "$COUNT" | grep -oPm1 "(?<=)[^<]+" ` echo $COUNT if [ "$COUNT" != "0" ]; then if [ "$COUNT" = "1" ];then WORD="mail"; else WORD="mails"; fi fi