#include #include //#include "fun.h" static int num = 0; static char storage[MAXLINE][MAXLINE]; void history(char *cmdline) { strcpy(storage[num], cmdline); num++; } void print_history(char *argv) { int i = 0; if(argv == NULL) { for(; i') { Isopen = 1; } i++; } if(Isopen == 0) { return 0; } i = 0; while (argv[i][0] != '>') { cmd_0[i] = argv[i]; i++; } cmd_0[i] = NULL; i++; int j = 0; while (argv[i]!=NULL) { cmd_1[j] = argv[i]; i++; j++; } cmd_1[j] = NULL; shell_direct(cmd_0, cmd_1); return 1; } /* void mytop() { FILE *fp; unsigned int pagesize; unsigned long total, free, largest, cached; if ((fp = fopen("/proc/meminfo", "r")) == NULL) return 0; if (fscanf(fp, "%u %lu %lu %lu %lu", &pagesize, &total, &free, &largest, &cached) != 5) { fclose(fp); return 0; } fclose(fp); printf("main memory: %ldK total, %ldK free, %ldK contig free, %ldK cached\n", (pagesize * total)/1024, (pagesize * free)/1024, (pagesize * largest)/1024, (pagesize * cached)/1024); return 1; } */