#!/bin/sh HOWMANY="10" URL="https://username:password@mail.google.com/mail/feed/atom" headarg="-$HOWMANY" curl --silent "$URL" > ~/.gmail.txt grep -E '(^)' ~/.gmail.txt | \ sed -n '2,$p' | \ sed -e 's/<title>Gmail - Inbox for //' | sed -e 's/<title>//' | sed -e 's/<\/title>//' | head $headarg | sed G | sed 'n;d'