a3 - cs201 - shell continuation - 3 weeks - due Feb 25 ------------------------------------------------------- overview: enhance small shell - part 2 (3 weeks) features: 1. implement background command - if last char in line has ampersand, don't wait. e.g., myshell> ls & basic idea: read & character and do not do blocking wait or waitpid command. If the ampersand is not found - you block. 2. write a small program that you can execute that calls sleep(3) and waits a random amount of time from 1..10 seconds. Use this to test the next feature. Call this program mysleep. 3. modify shell to use waitpid and SIGCHILD signal to harvest zombies via signal handler that does not block (unless you need to for a particular pid). You should be able to deal with case #1, case #2 for both blocking and non-blocking processes. 4. built-in history command use malloc for a linked list of commands. You should be able to execute any command in list based on !. E.g., (myshell)% !5 to print out the fifth command (however calculated - up to you). You should be able to print the history list via a built-in history command. You should keep only the last 10 commands. 5. optional extra credit: If you want to implement a shell redirect (say < or >) or even a pipe, 5-10 extra credit points will be available. Turn-in: 1. typescript showing tests. 2. Makefile 3. all *.c and *.h files System and library calls: 1. waitpid(2) (wait(2) actually). 2. malloc(3), free(3) 3. sleep(3) 4. random(3) 5. optional: dup2(2)