summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-23 23:44:44 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-23 23:44:44 +0200
commit98eb242e282650e9c6645dd2e5290e144b105bb4 (patch)
tree69963b6d1d5f51d8eaa5552f402ed34e0bd58241 /userspace/foolshell.c
parentdadd5202a3ccfd8c03fb9eb60e6a15b0fb987672 (diff)
improved params and environment passing and started snake-game :)
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index 2abb549..0ec7e88 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -4,6 +4,7 @@
#include <string.h>
extern char **environ;
+
//
void hello()
{
@@ -13,7 +14,7 @@ void hello()
puts(
"\033c"
- "\033[37;44m"
+ "\033[36m"
" ______ __ ____ _____ \n"
" / ____/___ ____ / / / __ \\/ ___/ \n"
@@ -21,10 +22,11 @@ void hello()
" / __/ / /_/ / /_/ / / / /_/ /___/ / \n"
" /_/ \\____/\\____/_/ \\____//____/ \n"
" \n"
- "\033[37;43m"
+
+ "\033[37;44m"
" \n"
- " Welcome to FoolShell v0.7 (Compiled on " __DATE__ " at " __TIME__ "\n"
+ " Welcome to FoolShell v0.8 (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"
@@ -41,15 +43,20 @@ void hello()
void prompt()
{
- printf("%s%s",getenv("PWD"),getenv("PS1"));
+ printf("\033[36mfool\033[37m@\033[32mhill\033[33m:%s%s\033[37m",getenv("PWD"),getenv("PS1"));
}
+
int main(int argc, char **argv)
{
-
+/*
+ printf("argv= 0x%08x \n",argv);
+ printf("environ= 0x%08x \n",environ);
+*/
bool silent=false;
for(int i=0;i<argc;i++)
{
+// printf("%i:%s\n",i+1,argv[i]);
if(!strcmp(argv[i],"--silent"))silent=true;
}
@@ -57,8 +64,6 @@ int main(int argc, char **argv)
char *buf=malloc(256);
-
-
while(1)
{
prompt();
@@ -227,7 +232,7 @@ int process(char *buf)
int pid=fork();
if(pid!=0)
{
- printf("new task pid: %i \n",pid);
+ // printf("new task pid: %i \n",pid);
}
if(pid==0)
{