The tsh shell should do each of the builtin commands without creating a child process:
- quit
- jobs
- fg
- bg
So eval should next call
int builtin_cmd(char **argv)
passing the array of command line strings filled in by the parseline function.
- The builtin_cmd should determine if the command is one of the 4 built in commands and return 0 if it is not.
-
Otherwise, the builtin_cmd should handle any of the 4 built in commands before returning and return 1.
You can use the strcmp function to check. E.g.
if ( strcmp(argv[0], "quit") == 0 ) { exit(0); }...