summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index 819c5d6..7a4f616 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -3,20 +3,21 @@
#include <stdbool.h>
#include <string.h>
+extern char **environ;
//
void hello()
{
// ascci art: http://patorjk.com/software/taag/#p=testall&f=Cards&t=Fool%20OS
puts(
-
- " ______ __ ____ _____ \n"
- " / ____/___ ____ / / / __ \\/ ___/ \n"
- " / /_ / __ \\/ __ \\/ / / / / /\\__ \\ \n"
- " / __/ / /_/ / /_/ / / / /_/ /___/ / \n"
- " /_/ \\____/\\____/_/ \\____//____/ \n"
- " \n"
+
+ " ______ __ ____ _____ \n"
+ " / ____/___ ____ / / / __ \\/ ___/ \n"
+ " / /_ / __ \\/ __ \\/ / / / / /\\__ \\ \n"
+ " / __/ / /_/ / /_/ / / / /_/ /___/ / \n"
+ " /_/ \\____/\\____/_/ \\____//____/ \n"
+ " \n"
"Welcome to FoolShell v0.2 (Compiled on " __DATE__ " at " __TIME__ "\n"
- "--------------------------------------------------------------------\n\n"
+ "--------------------------------------------------------------------\n\n"
"type 'help' anytime to show shell built-ins\n"
"or execute user programms that are in the '/bin' directory (e.g. ls)\n"
);
@@ -24,9 +25,8 @@ void hello()
void prompt()
{
- printf(
- "$ "
- );
+ printf("%s",getenv("PS1"));
+ printf("%s",getenv("PS1"));
}
int main(int argc, char **argv)
@@ -125,7 +125,7 @@ int process(char *buf)
}
else if(!strcmp(command,"getenv"))
{
- printf("%s = %s \n",token[1],getenv(token[1]));
+ printf("%s = %s(0x%08X) \n",token[1],getenv(token[1]),getenv(token[1]));
}
else if(!strcmp(command,"putenv"))
{
@@ -139,7 +139,7 @@ int process(char *buf)
execve(token[0],token,0);
char buf[256];
sprintf(buf,"/bin/%s",token[0]);
- execve(buf,token,0);
+ execve(buf,token,environ);
puts("foolshell: command not found");
}