#! /usr/bin/python #! /usr/bin/python import os os.system('cat systems.py') import sys print ' ' print 'what is your info? (type CTRL-D when done)' w = sys.stdin.readlines() # keyboard input, ctrl-d to end print w import time print ' ' print time.ctime() # translate that to English print ' ' cmd = 'ls -l' fp = os.popen(cmd) res = fp.read() print res import commands print ' ' print commands.getoutput('ypcat passwd | egrep ":13:"') import re for line in re.split('\n',commands.getoutput('ypcat passwd')): if re.search(':13:',line): print line.split(':')[0], ': ', line.split(':')[4] print ' ' for line in re.split('\n',commands.getoutput('ypcat passwd')): if re.search('^cs[5-9][0-9]+:',line): print line.split(':')[0], ': ', line.split(':')[4]