diff --git a/Microshell/microshell b/Microshell/microshell index 6f23f84..42429d0 100755 Binary files a/Microshell/microshell and b/Microshell/microshell differ diff --git a/Microshell/microshell.c b/Microshell/microshell.c index 8c22488..d04e3f1 100644 --- a/Microshell/microshell.c +++ b/Microshell/microshell.c @@ -218,13 +218,17 @@ void myps (char **argv){ strcat(direc, "./"); strcat(direc, name); 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 wait(NULL); - if (fork() == 0) - execlp("sed", "sed", "-n", "6p", direc, NULL); + if (fork() == 0){ + execlp("sed", "sed", "-n", "1p", direc, NULL); + } else wait(NULL); }