Python 2.4.x here.
Been banging my head trying to get subprocess to work with glob.
Well, here's the problem area.
def runCommands(thecust, thedevice): thepath='/smithy/%s/%s' % (thecust,thedevice) thefiles=glob.glob(thepath + '/*.smithy.xml') p1=subprocess.Popen(["grep", "<record>"] + thefiles, stdout=subprocess.PIPE) p2=subprocess.Popen(['wc -l'], stdin=p1.stdout, stdout=subprocess.PIPE) p1.stdout.close() thecount=p2.communicate()[0] p1.wait() I receive numerous "grep: writing output: Broken pipe" errors on the screen.
It's got to be something simple I'm missing, I just can't spot it. Any idea?
Thank you in advance.