diff --git a/src/Pish.c b/src/Pish.c index 45a0104..b6fc767 100644 --- a/src/Pish.c +++ b/src/Pish.c @@ -10,16 +10,16 @@ int redirectCheck(char* command) { int check; - if(strchr(str, '|') != NULL){ + if(strchr(command, '|') != NULL){ check = 1; } - else if (strpbrk(str, ">>") != NULL){ + else if (strpbrk(command, ">>") != NULL){ check = 2; } - else if (strchr(str, '>') != NULL){ + else if (strchr(command, '>') != NULL){ check = 3; } - else if (strchr(str, '<') != NULL){ + else if (strchr(command, '<') != NULL){ check = 4; } else{ @@ -29,7 +29,25 @@ int redirectCheck(char* command) void ioRedirect(int sym, char* command) { // |1, >>2, >3, <4 - + if(sym == 1) + { + // | + } + else if(sym == 2) + { + // >> Append + // does not replace file contents just adds + } + else if(sym == 3) + { + // > Redirecting output + // create a file if doesnt exist + // replaces files contents + } + else + { + // < ?? + } } // Prints a prompt and then reads a command from the terminal