Created
February 20, 2012 08:46
-
-
Save razvandimescu/1868462 to your computer and use it in GitHub Desktop.
check all gmail accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gmail_accounts=( 'email1@gmail.com' 'email2@gmail.com' 'email3@gmail.com' ) | |
function check_mail { | |
curl -u $1 --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;' | |
} | |
if [ $1 = "all" ]; then | |
for (( i=0;i<${#gmail_accounts[@]};i++)); do | |
check_mail ${gmail_accounts[${i}]} | |
done | |
else | |
check_mail $1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment