Skip to content

Instantly share code, notes, and snippets.

@learningjs
Forked from smlb/gmail.sh
Last active August 29, 2015 14:25
Show Gist options
  • Save learningjs/b2d1181a51ef1dc8a2fd to your computer and use it in GitHub Desktop.
Save learningjs/b2d1181a51ef1dc8a2fd to your computer and use it in GitHub Desktop.
USER=your_username
PASS=your_passwd
COUNT=`curl -su $USER:$PASS https://mail.google.com/mail/feed/atom || echo "<fullcount>unknown number of</fullcount>"`
COUNT=`echo "$COUNT" | grep "<fullcount>" | sed -e s/"<fullcount>"// -e s/"<\/fullcount>"//`
echo $COUNT
if [ "$COUNT" != "0" ]; then
if [ "$COUNT" = "1" ];then
WORD="mail";
else
WORD="mails";
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment