sending commands to the unix shell

Rodrick Brown rodrick.brown at
Tue Oct 12 04:30:53 CEST 2010

Trying to do something very trivial why is it failing

I've tried three approaches
    1. os.system("/bin/cat %s | /bin/mail -s \'connection error\' %s" %
    2. os.system("/bin/mail -s \'connection error\' %s < %s" %
    3. p1 = sp.Popen(["/bin/cat", logFile], stdout=sp.PIPE)
        p2 = sp.Popen(["/bin/mail", "-s", "error", notifyList],
stdin=p1.stdout, stdout=sp.PIPE)

Please help and explain why all 3 methods fail.

[ Rodrick R. Brown ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list