Homework 2: Due after the midterm. 5 points. NOTICE: Please read this entire file before starting. There is an offensive "Collaboration Policy" notice at the end that, though it shouldn't be necessary to say, you should be aware of. Here are two scripts, adduser and isadir: http://www.classes.cs.uchicago.edu/classes/current/CS501/homework/adduser http://www.classes.cs.uchicago.edu/classes/current/CS501/homework/isadir adduser prompts the operator for account information (login name, etc), giving a default value for each. The user can set the value (by supplying something) or accept the default by just hitting return. isadir is an example of a script that parses standard UNIX-style flags on the command line. Please read it. Augment the adduser script with non-interactive functionality. Use getopts (use isadir as an example) to parse the command line. The new adduser should accept the following arguments: -l login -c crypt -u uid -g gid -n name (gecos) -h home directory -s shell If any of the above arguments aren't supplied, the user should be prompted (using a default value, as the original adduser does) for a value. In addition, adduser should accept the flag: -f If the user supplies a "-f" (it stands for "force") flag to the script, the script should just use the default values and not prompt the user. If the script ever has to prompt the user, it should also ask them before adding the line to the password file. But if all of the arguments are supplied, or if the force flag is given, it should not ask the user before adding the line. Setup: Before testing the scripts, you should setup a password file and group file for use. Take the example ones I put in the homework directory: http://www.classes.cs.uchicago.edu/classes/current/CS501/homework/passwd http://www.classes.cs.uchicago.edu/classes/current/CS501/homework/group Collaboration Policy: Any homeworks that "look too similar" to another persons homework will be subject to intense scrutiny. You will be obligated to come in to my office and do another (similar) assignment in front of me. You are free to discuss how to do the assignment with other students, but your implementation must be your own.