All homeworks are to be submitted via a Bitbucket repository described in class. Within the repository, each assignment should be contained in its own directory named based on the assignment number (e.g. A1/ , A2/ , A3/ , etc.)

Help

How to create a typescript

Use the Unix command script to make typescript of terminal session.
Simply type the command "script" before you start running your program. You will see the message "Script started, file is typescript". After that, everything you type in and everything displayed on the screen will be saved in the file "typescript". When you're done with the execution, type "exit" (to exit from the Unix script program). You'll see the message "Script done, file is typescript".
For more detail, you should check out the man page for the script program to see how to make a typescript.

Make a zip file of your program directory

Below is an example that creates a zip file for submission. Again assume that your CS login name is "wuchang". First, you will create the directory "wuchang" (say, under /u/wuchang/cs201) and copy all the files and directories to be submitted into the directory /u/wuchang/cs201/wuchang/. Copying is done via the command "cp". The "-p" flag will preserve the original time stamps of your files while the "-r" flag will copy directories recursively. Below shows a screen shot of making the zip.

    /u/wuchang/cs201/> ls wuchang/
    Makefile test.c typescript
    /u/wuchang/cs201/> zip -r wuchang-Feng-Wu-A1.zip wuchang/*
      adding: wuchang/Makefile (stored 0%)
      adding: wuchang/test.c (stored 0%)
      adding: wuchang/typescript (stored 0%)

    /u/wuchang/cs201/> ls -l wuchang-Feng-Wu-A1.zip
    -rw------- 1 wuchang them 10240 Mar 31 10:00 wuchang-Feng-Wu-A1.zip
Related commands:
  1. To see what files are in a zip file, say "wuchang-Feng-Wu-A1.zip", do the following:
         unzip -l wuchang-Feng-Wu-A1.zip
    Note this command does not extract files from wuchang-Feng-Wu-A1.zip, but rather it shows what're inside it. This is very useful before you actually extract a zip file.
  2. To unzip a zip file, say "wuchang-Feng-Wu-A1.zip", do the following:
         unzip wuchang-Feng-Wu-A1.zip
    This will create the directory "wuchang" with all the files that are inside it. Warning: whatever files and directories in wuchang-Feng-Wu-A1.zip will overwrite existing ones with the same names. To test this command, it's better that you do it under a temporary directory so that you don't overwrite anything by accident.

Go to home page