From 48abbcee80a5066159b8ffee5602728dd45b94e4 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Mon, 24 Nov 2014 02:54:32 +0100 Subject: fixed ENV problem --- userspace/foolshell.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'userspace/foolshell.c') diff --git a/userspace/foolshell.c b/userspace/foolshell.c index 9002269..2a70940 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -105,7 +105,7 @@ int process(char *buf) if(!strcmp(command,"help")) { - puts("foolshell: supported built-in commands: 'help', 'echo [string]', 'malloc [bytes]', 'free [address]', 'getenv [var]', 'putenv [var] [val]'"); + puts("foolshell: supported built-in commands: 'help', 'echo [string]', 'malloc [bytes]', 'free [address]', 'getenv [var]', 'putenv [var] [val]', 'env'"); } else if(!strcmp(command,"echo")) { @@ -133,6 +133,16 @@ int process(char *buf) putenv(buf); printf("(0x%08X) set: %s = %s \n",environ,token[1],getenv(token[1])); } + else if(!strcmp(command,"env")) + { + int i=0; + printf("env: 0x%08X\n",environ); + while(environ[i]!=NULL) + { + printf("envvar %s (0x%08X)\n" ,environ[i],environ[i]); + i++; + } + } else { execve(token[0],token,0); -- cgit v1.2.3