Question: This is the shell that was given: #include #include #include #include #include #include #include #include #define MAXLINE 80 #define MAXARGS 20 #define MAX_PATH_LENGTH 50 #define




This is the shell that was given:
#include
} /* end of the if-else-if */ } /* end of the while */ } /* end of main */ /* ----------------------------------------------------------------- */ /* parseline */ /* ----------------------------------------------------------------- */ /* parse input line into argc/argv format */ int parseline(char *cmdline, char **argv) { int count = 0; char *separator = " \t"; /* Includes space, Enter, Tab */ /* strtok searches for the characters listed in separator */ argv[count] = strtok(cmdline, separator); while ((argv[count] != NULL) && (count+1 , or both */ /* Step 2: perform system call execvp to execute command */ /* Hint: Please be sure to review execvp.c sample program */ /* if (........ == -1) { */ /* fprintf(stderr, "Error on the exec call "); */ /* _exit(EXIT_FAILURE); */ /* } */ // } /* ----------------------------------------------------------------- */ //void handle_redir(int count, char *argv[]) /* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
PURPOSE: The purpose of this lab is to allow students to learn a user interface aspect of a UNIX shell. Student will work with process management and some basic system calls. Important note: please use sp1, sp2, sp3, or atoz servers for this lab. UNIX Shell We will start with 3 built-in commands: exit (exit shell) pwd (print working directory) cd (change directory) The built-in functions are not executed by forking and executing an executable. Instead, the shell process executes them itself. Your shell is basically an interactive loop it repeatedly prints a prompt "csc60msh>", parses the input, executes the command specified on that line of input, and waits for the command to finish
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
