Replaced pipes and reading from file streams with exec and stringstream