diff --git a/Microshell/microshell b/Microshell/microshell index 1e2cd0d..6f23f84 100755 Binary files a/Microshell/microshell and b/Microshell/microshell differ diff --git a/Microshell/microshell.c b/Microshell/microshell.c index 40ece5a..8c22488 100644 --- a/Microshell/microshell.c +++ b/Microshell/microshell.c @@ -10,6 +10,7 @@ #include #include #include +#include const int max = 1000; @@ -188,6 +189,53 @@ void mycp (char **argv){ } } +void myps (char **argv){ + if (fork() == 0){ + if (chdir("/proc") != 0){ + perror("cant open /proc"); + exit(0); + } + else{ /*weszlismy w 1 fork do katalogu proc */ + DIR *d; + struct dirent *ent; + int i, p; + + if ((d = opendir("/proc")) != NULL){ /*otwieramy proc*/ + while ((ent = readdir(d)) != NULL){ /*czytamy zawartosc*/ + char *name = ent->d_name; + p=0; + for (i=0; i