I have a C++ code that depends on the output of a shell script, but also requires user input. If I pipe from the script into program then all of the user input cin's get piped into as well. How do I fix this?
Some code may help:
1 2 3 4 5 6 7
cin >> howMany; //I want this input to come from the script
//This will always only be the first entry
cout << "what is your name" << endl;
cin >> name; //I want this to come from the terminal
Is there a way to open two streams, one from the pipe and the other from the terminal?