#!/usr/bin/python import os print "Content-Type: text/plain; format=flowed\n" def format(s): result = [] s = s.strip() if len(s) > 80: return s[:80] + '\n ' + format(s[80:]) else: return s keys = os.environ.keys() keys.sort() for key in keys: print format("%s: %s" % (key, os.environ[key]))