def METHOD_NAME(srctxt, env):
    # evaluate shell source text and print the value of env var
    env = env.encode()
    # only eval lines that contain the env var we are interested in
    grepped = b"\n".join( line for line in srctxt.splitlines() if env in line )
    sh_code = 'eval "$1"; echo "${!2}"'
    cmdline = ["/bin/bash", "-c", sh_code, "-", grepped, env]
    sh_eval = Popen(cmdline, stdout=PIPE).communicate()[0] or b''
    return sh_eval.decode()