CS 450: Project 1A: Unix Warmup

Overview

The project description can be found in the Github classroom link sent out in Piazza. Please read it carefully to understand what you should be doing.

Notes

Before beginning: If you don't remember much about the Unix/C environment, read this tutorial. It has some useful tips on C programming, debugging, and getting around a Unix like environment.

This project should be done alone! Copying code (from others) is considered cheating. If we detect plagiarized code, severe penalties will be applied. Please do us all a favor and do your own work (otherwise, why are you here?).

Getting the Starter Code

You should start by going to the GitHub Classroom link posted in Piazza. It might ask you to create a GitHub account if you don't already have one. You should accept the invitation and then go to the link it gives you. Please make sure to associate your account with your A# when you accept the invitation. If you've never used git before, you might want to check this out. Once you accept the invitation, you should get a link to clone your newly created private repository from.

From there, you should be able to clone the starter code like so:

            
[you@your-machine] git clone https:/github.com/IIT-CS450-F20/project-1a-unix-warmup-<your github username>
            
            

You've now got the starter code. We have provided a Dockerfile for you so that you can set up a build/test environment for your code. You can use it as follows:

            
[you@your-machine] cd project-1a-unix-warmup-<your github username>
[you@your-machine] docker build --tag p1a .
[you@your-machine] docker run -it --volume $PWD:/p1a p1a bash
            
            

If you're on windows and not using Cygwin, the invocation above probably won't work. $PWD is a shell environment variable that stands for the current directory. The Windows command prompt (for example) has no idea what this means. In that case, try the following:

            
[you@your-machine] docker run -it --volume "%cd%":/p1a p1a bash
            
            

The first Docker command tells it to build an image from the Dockerfile in your current directory, and give it the name p1a. The second command runs the image, and shares the current directory with the container (mounting it in the container in the p1a directory). You should now be sitting at a bash shell inside the container, and it should have everything you need to build and test.

            
[root@container] cd p1a
[root@container] ls -la
            
            

Due Dates and Logistics

This project is due Tuesday, September 8, 2020 at 11:59PM. Late submissions will be penalized as per the syllabus.

Testing Your Code

You can test your code by using make. There is a test for each component of the project. For example, to test your cat program, you can run:

            
[root@container] make test-my-cat
            
            

You can also run test-my-zip, test-my-unzip, or test-my-grep. If you'd like to run all tests:

            
[root@container] make test-all
            
            

Make sure to test often, and be sure that your code passes all tests before handing your code in. You will only get credit for tests that you pass. Note that the testing framework will stop on a failed test. If you'd like it to continue anyway, you can add an environment variable, like so:

            
[root@container] make CONTINUE=true test-all
            
            

Using Git

You want to make commits often in git when you change your code. It's a good idea to do this outside of the container, since your local machine has your git credentials set up already (you can do this in the container too if you'd like). Be careful to always include the -v flag of docker run so that changes you make in the container will still stick around when the container exits. Otherwise, they will be lost!

Handing In

IMPORANT:Before you hand in, make sure to add (and commit) a file named "info.txt" which contains your full name, e-mail address, and A#. We need this information to associate you with your GitHub account (Blackboard does not know who ca$hM0ney123 is!).

As you go, you should be making commits using git to your local repository (again, if you've not used git, you should go to the link above). When you're ready to hand in your code, you can just run (not inside the container, unless you have set up your git credentials inside it):

            
[you@machine] make handin
            
            

If you have modified files you haven't commited, the handin script will warn you. This handin script actually just invokes git push. If you do not provide an info.txt file, it will also complain and refuse to hand in.

Remember that you will be docked points for late work as per the syllabus.

Questions?

If you have questions, please first post them on Piazza so others can get the benefit of the instructor/TA's answer. If this does not resolve your issue, contact the instructor or TA, or come to office hours.