|  |  | Python Library Reference |  |  |

Previous: 6.8.3.1 Replacing /bin/sh shell Up: 6.8.3 Replacing Older Functions Next: 6.8.3.3 Replacing os.system()

### 6.8.3.2 Replacing shell pipe line

    output=`dmesg | grep hda`
    ==>
    p1 = Popen(["dmesg"], stdout=PIPE)
    p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
    output = p2.communicate()[0]

|  |  | Python Library Reference |  |  |

Previous: 6.8.3.1 Replacing /bin/sh shell Up: 6.8.3 Replacing Older Functions Next: 6.8.3.3 Replacing os.system()

Release 2.4.3, documentation updated on 29 March 2006.