PoshCode Archive  Artifact [e41a13b52d]

Artifact e41a13b52d31d09c3a1c274629d4f1bf46948a54c9b4bf4a5c26bd9651781910:

  • File Check-new-gmail.ps1 — part of check-in [84fd6ea798] at 2018-06-10 13:42:58 on branch trunk — Sometimes I have to deal with Bash, so… (user: greg zakharov size: 675)

# encoding: ascii
# api: bash
# title: Check new gmail
# description: Sometimes I have to deal with Bash, so…
# version: 0.1
# author: greg zakharov
# license: CC0
# x-poshcode-id: 4560
# x-archived: 2013-11-01T01:51:55
# x-published: 2013-10-26T16:19:00
#
#
#!/bin/bash

num="\033[1;36m"
end="\033[0m"

read -p "Enter email without '@gmail.com': " email
read -p "Enter password of email: " pass

atom=`wget -qO - https://$email:$pass@mail.google.com/mail/feed/atom \
   --secure-protocol=TLSv1 -T 3 -t 1 --no-check-certificat | grep \
   fullcount | sed -e 's/<fullcount>\(.*\)<\/fullcount>/\1/'`

echo -e 'You have '$num$atom$end' new letter(s)'