Unix Systems Programming: Lab 5 - fork & exec, pipes & filters

Due:           Friday, February 12, 2016 @ 5:00 pm  


Purpose and Rationale

The purpose of this lab is to allow students to become comfortable with the following fundamental Unix system calls:
as well with the utilization of Unix pipes, named and unnamed.

Recources

FAQ (submission instructions and other useful stuff)
You should refer to the required reading sections of the assigned texts in order to accomplish this lab.

All work should be done on a machine in the department's Linux cluster. You can refer to ssh for more information on how to log into a remote machine.

Marks Distribution

Part 1 6 points
Part 2 3 points
Part 3 3 points
TOTAL 12 points

LAB 5

The project consists of three parts. Each part is divided into discrete steps that you can follow.

Part 1 - Shell

Congratulations!  You are going to enhance  simple Unix shell -- the "gosh" shell (Grand Ole SHell)

The purpose of this part is to beef up your own shell in C.  This simple project is designed to give the programmer a working knowledge of fork/exec and dealing with file duplication procedures.

We have provided you with a simple shell template that you can choose to work from.  You can compile the shell using the following command assuming you've untarred the package and entered the gosh_template subdirectory:

gcc -I./ gosh_template.c -o gosh
Each step will define a test that you can run and expected behaviour.  Please make your shell follow this behaviour.

Part 2 - Unnamed Pipes

Part 3 - Named Pipes

Deliverables

Carefully follow the steps below.

  1. There will be three directories each corresponding to a separate problem. Make sure your name is at the top of every file. Every directory must include a make file to build your executable code. Be sure this file is called makefile. This make file must include a target clean, for removing all executables.
  2. When you are finished with your directory you will create a compressed archive file using tar (this utility stores your directory as a single file, then compresses its size.)
           tar -czvf   username.lab5.tgz   username.lab5

  3. You will email your file to our TA as an attachment. He will send an acknowledgement that your assignment has been received.

  4. To  Nicholas Flees (nickflees@uchicago.edu)
    Attachment  username.lab5.tgz
    Subject  CSPP51081-lab5