#!/bin/env python import os basedir = '/export/cit/' for d in range(1,8): cmd = 'python diskreport.py %s%d/cit > stat%d.txt' %(basedir, d, d) print cmd os.system(cmd)