Added dup2() for the subshell case