ps update
This commit is contained in:
parent
1bdf0defd2
commit
0e8d433065
Binary file not shown.
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user