diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-24 02:54:32 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-24 02:54:32 +0100 |
| commit | 48abbcee80a5066159b8ffee5602728dd45b94e4 (patch) | |
| tree | 3f311fdd93c67000eb66c5525782d1bdcf70a494 /userspace | |
| parent | 369c62119b9dd60db77fc28e8857ed9c4d498889 (diff) | |
fixed ENV problem
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/clear.c | 2 | ||||
| -rw-r--r-- | userspace/foolshell.c | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/userspace/clear.c b/userspace/clear.c index ab0eb51..09913c3 100644 --- a/userspace/clear.c +++ b/userspace/clear.c @@ -2,7 +2,7 @@ int main() { for(int i=0;i<24;i++) { - puts(); + puts(""); } return 0; 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); |
