pipe linux
void ejecutar(char **argv,int n){/*Funcion que ejecuta el exec*/
int i;
int pip[2];
pid_t pid;
int entrada=0;
//printf(stdout);
for(i=0;i<n-1;i++){
pipe(pip);
pid = fork();
if(pid == -1){/*ERROR AL HACER FORK*/
perror("FALLA FORK");
exit(EXIT_FAILURE);
}
if(pid == 0){/*PORCESO HIJO*/
if(execvp(argv[0],argv)){
perror("Falla Exec");
exit(1);
}
}else{/*PROCESO PADRE*/
close(pip[1]);
entrada = pip[0];
wait(NULL);
//kill(ret,SIGTERM);
}
}
}
Also in Shell:
- install tensorflow
- convert all files and folders in current directory into zip in linux
- linux command for get whole website
- run jar file command line
- how to rsync linux
- git change remote origin address
- add user to sudoers
- brew minikube custom version install
- kill a port
- change user linuxcommand ch
- pod deintegrate
- uninstall g2o
- search by message git
- linux replace string in all files
- whats the internet
- git delete stash
- open sketch file mac
- how to manage github repository
- powershell zip multiple files
- github undo last pushed commit
- docker to sudoers
- bash tee stdout and stderr
- commit the add complete folder to github
- git pull from commit