\-Dup(fd) takes the fd, and opens the lowest numbered available next fd to have the same destination as the given fd. (In this case, you want 0-2)
\-dup2(fd, destination) takes the fd, and replaces the destination fd to point to point to the same location as the fd you specified.
\-In the case any remaining fds are pipes, you would cause a hangup of the parent. (For ex, a perpetually open pipe write end). Thus, you should closed unused fds.
\*Note: both dup/dup2 return the newly created/ replaced fd. \[-1 for error\]