This is an old revision of the document!
Table of Contents
Weekly Labs
To do the labs, you must have an EECS account. Activate your account from any browser by following this link.
If you are in the lab, login with username active8 (password:active8) to activate your account.
<!--
-->
Lab 12 - December 2 and 3
Study Sections 12.3, 12.5, 12.6. and 12.9 from the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Answer this question.
Before Tuesday, December 3 at midnight, submit the solution to the above question with
submit 2031A Lab12 lab12.c
Solution: You can download a solution for Lab 12 here.
Lab 11 - November 25 and 26
Study the remainder of Chapter 8, as well as Chapter 9 from the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Answer this question.
Before Tuesday, November 26 at midnight, submit the solution to the above question with
submit 2031A Lab11 lab11.c
Solution: You can download a solution for Lab 11 here.
Testing: You can find all the test cases that were used to test your script automatically here.
Lab 10 - November 18 and 19
Study Chapters 7 and 8 (up to 8.7) of the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Complete and submit labs 7.6 and 7.7 as in the previous labs using
submit 2031A Lab10 <filename>
You must also answer this question.
Before Tuesday, November 19 at midnight, submit the solution to the above question with
submit 2031A Lab10 lab10.c
Develop and test your programs under Unix, as this is the way you will use for the lab test. You can then copy/paste your solution to your textbook for labs 7.6 and 7.7 in order to receive feedback.
Solution: You can download a solution for the non-textbook question here.
Testing: You can find all the test cases that were used to test your script automatically here.
Lab 9 - November 11 and 12
Study Chapters 5 and 6 of the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Complete and submit labs 5.29 and 6.37.
Develop and test your programs under Unix, as this is the way you will use for the lab test. You can then copy/paste your solution to your textbook in order to receive feedback.
As before, you can submit any C code you develop, so that it is available to you during the lab test. Before Tuesday, November 12 at midnight, submit any text-based files (programs, test cases etc) related to Lab 9 with
submit 2031A Lab9 <filename>
Lab 8 - November 4 and 5
Study Chapters 3 and 4 of the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Complete and submit labs 3.27 and 4.24.
Develop and test your programs under Unix, as this is the way you will use for the lab test. You can then copy/paste your solution to your textbook in order to receive feedback.
As before, you can submit any C code you develop, so that it is available to you during the lab test. Before Tuesday, November 5 at midnight, submit any text-based files (programs, test cases etc) related to Lab 8 with
submit 2031A Lab8 <filename>
Lab 7 - October 28 and 29
Study the first two chapters of the textbook. Complete as many of the participation and challenge activities as you need to fully understand the topics discussed.
Complete and submit labs 1.19 and 2.37.
Develop and test your programs under Unix, as this is the way you will use for the lab test. You can then copy/paste your solution to your textbook in order to receive feedback.
As before, you can submit any C code you develop, so that it is available to you during the lab test. Before Tuesday, October 29 at midnight, submit any text-based files (programs, test cases etc) related to Lab 7 with
submit 2031A Lab7 <filename>
<!--
-->
Lab 6 - October 21 and 22
All material related to the Unix lab tests can be found by clicking here.
Study the slides on git, and read the first two chapters of the Pro Git book.
Perform the following tasks:
- Configure git as shown on slide 7.
- Navigate to a directory containing some text-based files (a directory containing shell scripts will do).
- Initialize a git repository, add and commit files to it.
- Do a couple of iterations of changing the files (you can add comments to the scripts if you like) and re-commiting them.
- Display the log of all committed versions, as well as differences between various versions
- Checkout an earlier version, and check out the latest version again.
- If you don't have one already, create an account on github.com
- In your browser, create a new repository (choose an appropriate name).
- Github will give you the two commands you need to enter on the command line to push your local repository online.
- You should be able to see all your files on github.com now. Make more changes to your text files, commit them, push them online.
- Explore the capabilities of github.com (for your own learning).
Lab 5 - October 7 and 8
Lab Test 1 will take place during this lab session.
No paper or electronic aids are allowed during the lab test, however the following will be provided:
- All lecture slides
- The instructor solution for Lab 4
- All submissions you have made prior to the test
Students can make further submissions until Sunday, October 6 at 8pm. These submissions will not be automatically graded, but they will be available to you during the test.
Submit updated lab 4 solutions with
submit 2031 Lab5 <filename>
Please note that the written test on October 9 will be closed-book.
Lab 4 - September 30 and October 1
Study this Bourne shell tutorial as well.
Answer this question. Submit your answer by midnight on Tuesday, October 1.
Solution: You can download a solution for Lab 4 here.
Testing: You can find all the test cases that were used to test your script automatically here.
Lab 3 - September 23 and 24
Study this Bourne shell tutorial as well as this wikibook (for reference only).
Answer this question. Submit your answer by midnight on Tuesday, September 24.
Solution: You can download a solution for Lab 3 here. You can expand on this for Lab 4, or you can continue with your own code.
Testing: You can find all the test cases that were used to test your script automatically here. The last test case related to the bonus question, you can ignore it if you did not do that part.
Click here for an explanation of the feedback you received.
Lab 2 - September 16 and 17
Study the tutorials 5 and 6 from here. Try the examples and do the exercises.
Complete the following tasks:
- Using this phone book, do the following by issuing one command only:
- Display entries of people whose names contain the substring “alex”, case-insensitive. (The output should be the entries of alex johnson and Alexander Smith.)
- Display entries of people whose phone number ends in 2.
- Display only the names of people whose phone number does not contain the number 3.
- List all area codes in the phone book sorted numerically
- List the names of contacts in the 905 area code
- Suppose myFile is in your working directory. Specify the command(s) you would use to do the following:
- Give everyone permission to read myFile; do not change any other privileges.
- Permit the owner (you) and group members to read and write the file; remove all privileges from everyone else.
- Remove writing privileges from everyone but the owner.
- Give the owner and group members permission to execute myFile, while giving the owner sole permission to read and write the file.
- Suppose you have a directory named myStuff in your working directory. Specify the command(s) you would use to do the following:
- Give everyone permission to list files in myStuff; do not change any other privileges.
- Permit the owner and group members to list, remove, or add files; remove all privileges from everyone else.
- Remove writing privileges from everyone but the owner.
- Give the owner and group members permission to execute myStuff, while giving the owner sole permission to read and write the directory.
- Perform the following tasks. If you have less than 10 .txt files in your account, create some empty ones using the touch command
- List the number of .txt files in your home directory (including any subdirectories)
- List any 10 of the above files, each file preceded by the number of lines in it
- List all empty .txt files in your home directory (including any subdirectories)
- List all files that were modified in the last day in your home directory (including any subdirectories)
Don't forger to look at the man page of each command if you are not sure how to use them.
Nothing to submit this week as well (but next week there will be)!
Lab 1 - September 9 and 10
Study the introduction and the first four tutorials here. Try the examples and do the exercises.
Complete the following tasks:
- The echo command takes a line that you type and repeats it back on the screen. Use it with any text you want and redirect the output to a file named myFile.
- Use the echo command to input 5 more lines and append them to file myFile, which will contain a total of 6 lines of text.
- Append to file myFile the output of the following commands: who, whoami, and date.
- Create a set of text files and name them backgammon, backpacking, baseball, boxing, biking, chess, fencing, blackjack, groupA, groupB, groupX, groupY.
- How would you use cat to show the contents of the files ending in ing?
- How would you list any files containing x or X in the file names?
- How would you show the contents of files with names containing o?
- How would you show the contents of the files backgammon, backpacking and blackjack using just one command?
- How would you copy the contents of all 3 files backgammon, backpacking and blackjack to a file named all3 using just one command?
- Given this file, specify the command(s) you would use to do the following:
- Count the number of people whose area code is 905. Display just the count (not the entries).
- Display the entries of the babysitters.
- Count the number of friends whose names are in phone_book. Display just the count (not the entries).
To answer question 5, read ahead in the tutorials on grep.
There is nothing to submit this week!