PATH:
usr
/
lib64
/
python2.7
/
Demo
/
scripts
#! /usr/bin/env python # Print From and Subject of messages in $MAIL. # Extension to multiple mailboxes and other bells & whistles are left # as exercises for the reader. import sys, os # Open mailbox file. Exits with exception when this fails. try: mailbox = os.environ['MAIL'] except (AttributeError, KeyError): sys.stderr.write('No environment variable $MAIL\n') sys.exit(2) try: mail = open(mailbox) except IOError: sys.exit('Cannot open mailbox file: ' + mailbox) while 1: line = mail.readline() if not line: break # EOF if line.startswith('From '): # Start of message found print line[:-1], while 1: line = mail.readline() if not line or line == '\n': break if line.startswith('Subject: '): print repr(line[9:-1]), print
[-] pi.pyo
[edit]
[-] eqfix.pyo
[edit]
[-] makedir.pyc
[edit]
[-] queens.py
[edit]
[-] queens.pyo
[edit]
[-] pp.py
[edit]
[-] unbirthday.py
[edit]
[-] update.pyo
[edit]
[-] fact.pyc
[edit]
[-] pp.pyc
[edit]
[-] primes.pyo
[edit]
[-] markov.pyc
[edit]
[-] eqfix.py
[edit]
[-] mboxconvert.pyo
[edit]
[+]
..
[-] newslist.py
[edit]
[-] README
[edit]
[-] newslist.pyc
[edit]
[-] markov.py
[edit]
[-] newslist.pyo
[edit]
[-] pi.pyc
[edit]
[-] morse.py
[edit]
[-] beer.pyc
[edit]
[-] newslist.doc
[edit]
[-] beer.pyo
[edit]
[-] primes.py
[edit]
[-] pi.py
[edit]
[-] find-uname.pyc
[edit]
[-] makedir.pyo
[edit]
[-] eqfix.pyc
[edit]
[-] mboxconvert.pyc
[edit]
[-] fact.py
[edit]
[-] unbirthday.pyc
[edit]
[-] script.pyo
[edit]
[-] primes.pyc
[edit]
[-] find-uname.pyo
[edit]
[-] lpwatch.pyo
[edit]
[-] morse.pyo
[edit]
[-] fact.pyo
[edit]
[-] morse.pyc
[edit]
[-] from.py
[edit]
[-] from.pyo
[edit]
[-] makedir.py
[edit]
[-] update.py
[edit]
[-] lpwatch.pyc
[edit]
[-] find-uname.py
[edit]
[-] script.pyc
[edit]
[-] queens.pyc
[edit]
[-] from.pyc
[edit]
[-] unbirthday.pyo
[edit]
[-] lpwatch.py
[edit]
[-] beer.py
[edit]
[-] markov.pyo
[edit]
[-] update.pyc
[edit]
[-] pp.pyo
[edit]
[-] mboxconvert.py
[edit]
[-] script.py
[edit]