19 lines
316 B
C
19 lines
316 B
C
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <sys/wait.h>
|
|
|
|
int main(int argc, char* argv[]){
|
|
for(int i=2;i<argc;i++){
|
|
wait(NULL);
|
|
pid_t p = fork();
|
|
if(p==0){
|
|
execl(argv[1],argv[1],argv[i],NULL);
|
|
assert(0);
|
|
}
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|