diff options
Diffstat (limited to 'userspace/foolshell.c')
| -rw-r--r-- | userspace/foolshell.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c index ba73e1d..a502f47 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -8,13 +8,8 @@ extern char **environ; extern struct _reent *_impure_ptr; - - uint8_t buf_test[1024*300]; - - - // void hello() { @@ -36,7 +31,7 @@ void hello() "\033[37;44m" " \n" - " Welcome to FoolShell v0.8 (Compiled on " __DATE__ " at " __TIME__")\n" + " Welcome to FoolShell v0.12 (Compiled on " __DATE__ " at " __TIME__")\n" " ------------------------------------------------------------------\n\n" " Please type 'help' anytime, to show shell \"built-ins\". You can execute \n" " user programms that are in your $PATH directory by simply typing \n" @@ -147,6 +142,7 @@ int process(char *buf) "'cd [dir]' - change directory (set $PWD)\n" "'exit' - exit running foolshell\n\n"); } + else if(!strcmp(command,"cd")) { char *dir=getenv("PWD"); @@ -241,7 +237,7 @@ int process(char *buf) } else { - int pid=fork(); + int pid=_fork(); if(pid!=0) { // printf("new task pid: %i \n",pid); @@ -250,15 +246,15 @@ int process(char *buf) { char buf[256]; sprintf(buf,"%s",token[0]); - execve(buf,token,environ); + _execve(buf,token,environ); //sprintf(buf,"%s/%s",getenv("PATH"),token[0]); sprintf(buf,"%s/%s","/bin",token[0]); - execve(buf,token,environ); + _execve(buf,token,environ); puts("foolshell: command not found"); exit(1); } int status; - if(strcmp(token[1],"branch"))wait(&status); + if(strcmp(token[1],"branch"))_wait(&status); } return 0; |
