Fixed an error wrong name in checkRedirect

This commit is contained in:
Samantha Boyer 2022-10-25 21:01:53 -05:00
parent adc4064f08
commit 8504f22597

View File

@ -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