ps update

This commit is contained in:
Jakub Adamski 2019-01-18 19:43:13 +01:00
parent 1bdf0defd2
commit 0e8d433065
2 changed files with 8 additions and 4 deletions

Binary file not shown.

View File

@ -218,13 +218,17 @@ void myps (char **argv){
strcat(direc, "./"); strcat(direc, "./");
strcat(direc, name); strcat(direc, name);
strcat(direc, "/status"); /*tworzenie sciezki*/ strcat(direc, "/status"); /*tworzenie sciezki*/
if (fork() == 0)
execlp("sed", "sed", "-n", "1p", direc, NULL); if (fork() == 0){
printf("Pid: %s ", name);
exit(0);
}
else else
wait(NULL); wait(NULL);
if (fork() == 0) if (fork() == 0){
execlp("sed", "sed", "-n", "6p", direc, NULL); execlp("sed", "sed", "-n", "1p", direc, NULL);
}
else else
wait(NULL); wait(NULL);
} }