I was having a little trouble with parsing my command upon input, I'm new to C so any help would be greatful! Here is what i have so far i'm trying to make a simple unix shell
char*token;
while(1){
//prints users prompt
printf("\n%s@myshell:%s>", username,curDirect);
//gets string from command line
fgets(buffer, MAX_COMMAND_SIZE + 1, stdin);
//parses tokens
token = strtok(buffer,whitespace);
while(token != NULL)
{
if(strcmp(token, "<") == 0)
{
parse to <
}
else if(strcmp(token, ">" == 0)
{
//parse to >
}
else if(strcmp(token, "&",1 == 0)
token = strtok(NULL,whitespace);
}//token while loop
}//end while loop
return 0;
}//End Main loop