nus/cs2106/labs/lab2/part2/lab2p2c.c

13 lines
184 B
C

#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
int main() {
if(fork() == 0) {
execlp("cat", "cat", "file.txt", NULL);
}
else
wait(NULL);
}