I am trying to replace stdin with another pipe, then place the original stdin back to fd #0.
e.g.
dup2(p, 0); // p is a pre-existing fd of a pipe
exec(/* some commands */);
//what will be here in order to have the original stdin back?
scanf(...) //continue processing with original stdin.