#include #include #include #include int main(void) { int fd = open("test.txt", O_CREAT | O_WRONLY); if(fd < 0) { printf("Error opening the file\n"); } dup2(fd, 1); printf("Tester\n"); close(fd); }