ae5ed846e685c3ac4aa30ff9e9e7c47ac513b8db
10 int out_file_fd
= open("ouput.txt", O_CREAT
| O_WRONLY
, S_IRUSR
| S_IWUSR
);
11 if (out_file_fd
< 0) {
12 perror("open failure\n");
16 dup2(out_file_fd
, STDOUT_FILENO
);
18 execl("/bin/ls", "ls", (char*)NULL
);