/************************************************************************* > File Name: Kris_shell.c > Author: KrisChou > Mail:zhoujx0219@163.com > Created Time: Thu 21 Aug 2014 04:31:55 PM CST ************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <sys/wait.h> #define PROMPT ">>" #define ARG_CNT 32 void command_to_arglist(char** arglist,char *cmd_line);
int main(int argc, char *argv[]) { char cmd_line[1024]; char *arglist[ARG_CNT]; while(memset(cmd_line,0,1024), printf("%s",PROMPT), fgets(cmd_line,1024,stdin)) { if(cmd_line[0] != ' ') { cmd_line[strlen(cmd_line) - 1] = '