how do we get the output of a subprocess of a subprocess
Question: Could someone share a sample of python script that shows the output of a
subprocess (java kicked off by file.bin) of a subprocess (kicking off a
file.bin) ?

The subprocess (java kicked off by file.bin) of a subprocess (kicking off a file.bin) looks like this below from a `ps -ef | grep java`

`rrr 26267 26266 0 16:05 pts/12 00:00:03
/tmp/install.dir.26267/Linux/resource/jre/bin/java com.rew.erg.REW
/tmp/install.dir.26267/temp.erg /tmp/env.properties.26267 "-i" "console"`

How do we hook up to the subprocess of another subprocess and perform
interaction with it like an expect or pexpect script?


Answer: There are many ways to do that, here is just an example:

    
    
    import subprocess
    try:
        output = subprocess.check_output(cmd, stderr=subprocess.STDOUT,shell=True)
    except subprocess.CalledProcessError, ex:
        ret = ex.returncode
    

