The
dup2()
function in Unix and Linux operating systems is used for duplicating file descriptors. It takes two arguments: the old file descriptor and the new file descriptor. The function makes the new file descriptor to be a copy of the old one.- Pipe standard output from child process to parent process input