C system calls pipe, fork, and execl
问题 I fork()'d a child process and created pipes between them and am able to send argument argv[1] to the child. I want the child to take that filename provided from argv[1] and perform an execl("/bin/cat","cat",(char *) 0); How do I route the filename piped to the child to the execl? Enclose is my code for clearity : int main(int argc, char ** argv){ int fds[2]; char buffer[100]; int status; if(pipe(fds) == -1){ perror("pipe creation failed"); exit(EXIT_FAILURE); } switch (fork()){ case 0:/