CS631 -- Advanced Programming in the UNIX Environment - Final AssignmentWrite a simple shellSummaryIn this assignment you will write a simple shell. In doing so, you will apply most of the lessons we learned in this class and gain a better understanding of how complex something as simple as a command-line interpreter can become as you compare the features available in a POSIX compliant shell with your own simple shell. Problem assignmentWrite a simple command-line interpreter as described in this manual page. As usual, your homework submission / program will:
HintsGiven the number of aspects covered in this assignment, I would suggest that you try to implement features incrementally in the following order: Shell startup, options parsing, command parsing / tokenizationBegin by implementing the standard getopt(3) flow, initialize your world, print a command-line prompt and read input from the controlling terminal. Split the given string into tokens. Make sure your shell can't be terminated by Ctrl+C, Ctrl+\, be suspended via Ctrl+z and can be exited successfully. BuiltinsImplement all listed builtins with all supported arguments / exit status. Resist the temptation to implement additional features not requested in the assignment. Fork-exec commandsCreate a new process and execute commands. Wait for them to complete. Reap your children. Make their exit status available. Implement I/O RedirectionInspect the list of tokens for supported I/O redirection operators. Ensure no illegal combination is given. Implement the correct redirection. Make sure to handle error cases correctly and report meaningful errors to the user. Implement pipelinesSplit the input by the pipe operator before tokenization. Fork new processes for each command in the pipe, connect stdout/stdin as needed. Execute the commands. Implement backgrounding of processesOnly implement placing commands into the background after all other functionality is present. TestingThe manual page includes a list of examples. You should consider those basic minimum functionality that your shell should provide as shown there. In your README, please elaborate on what other tests you considered. Deliverables and Due DateYou will submit a single tar archive named username-sish.tar that will extract into a directory named after your username. Make sure to include all the files as required by the general homework submission guidelines. The due date for this assignment is 2022-12-22 18:00. Please attach the file to an email sent from your @stevens.edu email address to jschauma@stevens.edu with a subject of "[CS631] sish". [Course Website] |