Skip to content

Instantly share code, notes, and snippets.

@jansanchez
Created November 19, 2013 16:35
Show Gist options
  • Save jansanchez/7548257 to your computer and use it in GitHub Desktop.
Save jansanchez/7548257 to your computer and use it in GitHub Desktop.
Read Gmail in Terminal

Read Gmail in Terminal

###creake the file gmail.sh with this content

#!/bin/bash
curl -u username --silent "https://mail.google.com/mail/feed/atom/all" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/ ⬓ \2 - \1/p"

####Type your username

###If you want login directly type the next:

#!/bin/bash
curl -u username:password --silent "https://mail.google.com/mail/feed/atom/all" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/ ⬓ \2 - \1/p"

####Type your username and password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment