Hi, this is a beginners question, I appreciate you taking the time to help me out.
The motivation:
I want to take the standard output of a shell command (in Red Hat, using tcsh, in my case) and redirect it into my program for processing.
(Then ideally I would love to take the output of my program and redirect it to yet another command, but this is a second issue.)
Simple example:
I naively thought this might work:
I want to type this on the shell:
Code:
$ echo Harry > hello
and I was expecting this output on my terminal:
And this would be my simple hello program:
Code:
#include <iostream>
#include <string>
int main() {
std::string usrInput;
std::cin >> usrInput;
std::cout << "hello, " << usrInput << std::endl;
return 0;
}
Thank you very much for your help!