Week 05 Tutorial Questions

Objectives

  1. The assignment specification doesn't fully explain the assignment - what can I do?

  2. How hard are the subsets?

  3. What does git init do?

    How does this differ from svc-init?

  4. What do git add file and svc-add file do?

  5. What is the index in svc (and git), and where does it get stored?

  6. What is a commit in svc (and git), and where does it get stored?

  7. Apart from the svc-* scripts what else do you need to submit (and give an example)?

  8. You work on the assignment for a couple of hours tonight.
    What do you need to do when you are finished?

  9. Write a shell script extract.sh that, when given one or more archive files as command line arguments, will use the correct program to extract the files.

  10. Given an anonymous list of CSE logins.

    Write a shell script last.sh that, using shell case statements, finds the number of logins that occurred from within UNSW.
    (Look for connections from the uniwide network).

    Additionally, find the distribution of zIDs by their first digit.

    ./last.sh
    3739 uniwide logins
    z0: 1604, z1: 1484, z2: 1527, z3: 1574, z4: 1521, z5: 1565, z6: 1547, z7: 1485, z8: 1537, z9: 1607
    class: 378
    
  11. Write a shell function top-and-bottom that, given a file name, prints the file name, plus the first and last lines of the file.

    . top-and-bottom.sh
    top-and-bottom /usr/share/dict/british-english-insane
    =================
    /usr/share/dict/british-english-insane
    -----------------
    A
    zzz
    =================
    
  12. Write a shell function print_message that, given an optional exit status and a message:

    If no exit status is given, the program should print a warning.
    If an exit status is given, the program should print an error and exit the program.

  13. Create a git repository called cs2041-Labs and add your week01 and week02 lab work.

    Then push your repository to the CSE gitlab servers.

    When logging into the CSE gitlab, make sure you "Login with UNSW Single Sign On".
    Not with the standard "Username" and "Password" fields.

  14. There is a git repository located on the CSE gitlab servers at https://gitlab.cse.unsw.edu.au/cs2041/26t1-tut05
    Clone this repository to your local machine.