in reply to piping in & out?

No idea of the specifics of what you're doing, but it's entirely possible that Expect might work better for you than open with pipe, or socket, or named pipe, etc. Check it out. =)