Due by 11:59PM EDT on Thursday, April 14, 2016
Sunday, April 3 @ 16:13 EDT — clarified that scripts are non-interactive, and that anything (logging, .421sh_profile) pertaining only to interactive mode does not apply when running a script from the command line.
20 points
Please provide written responses to the following questions. Each response should be about 5-7 sentences in length. Each question is worth 5 points.
Allocation Max Available A B C D A B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P2 1 3 5 4 2 3 5 6 P3 0 6 3 2 0 6 5 2 P4 0 0 1 4 0 6 5 6
You must submit a PDF file of the answers to these questions on the Homework 3 assignment on Blackboard. You may prepare your responses in any word processing application of your choosing, but you must submit a PDF file. Do not submit Microsoft Word/Apple Pages/LibreOffice/OpenOffice.org documents with your responses. You must convert to a PDF file before submitting or you will lose points.
30 points
Complete the following programming assigment and submit your code using the GitHub repository that you will have created for this assignment. This assignment must be completed in the C programming language (you can choose to use C89/C90/ANSI-C, C99, or C11 as you see fit).
In this assignment, you will be augmenting your shell from Homeworks 1 and 2 with a few new features:
As with homework 2, you are welcome to use the utility files that were provided in that assignment (here and the header file here). These files are unchanged from homework 2, so if you still have those versions in your repository, you should continue to use them.
The first_unquoted_space() function in the utils.c file can be used to aid in parsing commands without using functions like strtok_r() (which won't work for parsing because of requirements 1 and 2 of this assignment). Remember that C strings are just arrays, and you can easily overwrite characters at will. If you want to end a string at a given position, overwrite that character with a \0 character.
Remember, the first_unquoted_space() function returns -1 if there are no spaces left in the input string that are unquoted.
Your shell program is not allowed to use any external libraries other than the system's C library and the files provided in this assignment. Do not try to use libraries like Readline. You will lose points for using external libraries to implement shell functionality!
When submitting your shell program, please be sure to include the source code of the shell program (in one or more C source code files), as well as a Makefile that can be used to build the shell. Your shell must be able to be built and run on a VM as has been set up for this course in your projects. If you use my utility functions, make sure to include those files as well.
As this should be an extension of your earlier homework 1/2 shell, you should be using the same directory and git repository for it. To submit your code, you should do the following:
git add your_updated_and_added_files_go_here git commit git push -u origin master git tag hw3 git push origin --tags
Last modified