COMS 214 (Advanced Unix Tools), Spring 2005
MWF 12:20-13:10, Hollister 110
Course description
A focus on Unix as a programming environment
for people with a basic knowledge of Unix and experience programming in
at least one language. Projects cover advanced shell scripts (sh, ksh,
csh), Makefiles, programming and debugging tools for C and other
languages, and more modern scripting languages such as Perl and Python.
Students with little or no experience with Unix should take COM S 114
first.
COMS 214 is a four week, one credit, S/U only course. It runs
February 21 to March 18, 2005. The drop deadline is 2/28/05, one week
into the course.
Instructor
- Sabina Petride
- Email: petride@cs.cornell.edu
- Office: 342 Upson
- Office hours: Thursdays, 11:00-12:00, Upson Hall 342
Grading and course policies
There will be 3 homeworks, and a passing grade will require doing all
homeworks and getting at least 50% of the total points. This means that, even
if you have less than half the points for one assignment, a good second
assignment would make things even. Assignments will involve answering short
questions, writing scripts, and solving more complex problems by building the
scripts step by step. All assignments should be done individually.
Please take a look at
Cornell University Code of Academic Integrity.
If you have questions of any kind,
you can talk to me during office hours. If you cannot come
during office hours, send me an e-mail and I will find time to talk to you.
You can also post your questions on the newsgroup cornell.class.cs214 (the
Cornell newsgroup server is newsstand.cit.cornell.edu).
Announcements
Most recent first:
- 4/20/05: Last assignment has been graded and solutions have been posted. If you have questions about your grades, drop me an e-mail. I have really liked teaching this class and I could see that you've made progress, so I am glad. Have a good break!
- 3/28/05: Solutions for the second assignment have been posted.
- 3/28/05: Assignment 3 (and the last one) is posted. Here are the files you will need:
code.txt and genedoc.txt. Information about how to get help can be found at the end of the assignment. I will also have the office hour as usual, on Thursday from 11:00 to 12:00. Good luck!
- 3/14/05: These are the scripts we looked at during today's lecture: phone.pl,
arrays.pl, and assocarrays.pl.
- 3/14/05:The last two sections will take place the week after spring break: March 28 (Monday) and March 30 (Wednesday). I will be at a conference for the rest of this week, so if I do not reply to your message, it's just because I might not have Internet access. The last assignment will be posted shortly and will be due on April 4 (two weeks after spring break). Have a good break!
- 3/14/05: Assignment 1 has been graded, you can see your grades on CMS. If this does not work for you, send me an e-mail. The maximum number of points is 100: problem 1 is worth 60 points (8 points for each of the 5 short questions, 10 points for ws.sh and 10 points for wsc.sh), and problem 2 is worth 40 points (4 points for each of the 10 short questions). If there was the same mistake in misc.sh and in ws.sh, I took points off only once.If you did not get all 100 points, see the comments I wrote on CMS. If there are still questions, please write me an email; I will get back to you today, or after I come back to Ithaca.
- 3/13/05: This is the note on reading files in UNIX.
- 3/11/05: The deadline for assignment 2 has been extended to Monday, March 14, at noon.
- 3/8/05: Solutions for assignment 1 are posted; check lectures 6 and 7, and the solution for the last problem under Homeworks section.
- 3/8/05: These are the slides from Monday's lecture.
- 3/8/05: If you are interested in working for a human neuroimaging lab here in Cornell who needs a person familiar with UNIX, please contact Barbara Ganzel at blg4@cornell.edu, who is a
postoctoral associate with the lab. The work will be counted as credit, starting from this semester or the next
semester.
- 3/4/05: Since last Friday's lecture was canceled, we will have a lecture this Sunday, same place and time. In this lecture we will look at some examples of scripts that may use functions, loops, regular
expressions and pipelining. The lecture notes will be posted on the web most probably by Monday evening.
- 3/4/05: Assignment 2 has been posted this morning. It is due a week from now, on March 11, by
11:59pm. Please notice that, just as with the first assignment, the deadline is strict, unless you talk to
me in advance (this means at least a day before). Good luck!
- 2/25/05: I apologize, but I have to CANCEL today's lecture. My cold turned worse and I cannot speak.
Homework is extended for Wednesday, March 2, 11:59pm. I will post the lecture notes shortly. I will also come to Hollister 110 and give you the lecture notes, for those of you who do not read this announcement in time.
I plan to make up for this lecture sometime next week. I will first look for a free classroom for next week.
- 2/24/05: Accounts have been created for the CSUGLab.
Users with new accounts need to reset their passwords
here. You have all been added to the
cs214 group and Net-Print accounts have been sent to CIT for activation.
Here you can find information about how to connect to
your UNIX host turing.csuglab.cornell.edu.
You can submit your assignments using the CMS system.
- 2/21/05: The first assignment is posted under the Homeworks section. It is due in a week from
now, on February 28, by 11:59pm. Good luck!
- 2/21/05: Sample files for assignment 1, problem 1: interview1.txt (or download), and
article1.txt (or download).
- 1/26/2005: This year I will ask all of you who are interested to post on the
newsgroup (or send me an e-mail) with one or two problems that you want to solve and
that require using UNIX or Perl, whether it is scheduling tasks for your bioinformatics
simulations, or simply changing the prompt when you first log in on your pc. I will then
choose two problems that interest most of you and work on them during class and as
assignments.
- 1/25/2005: Welcome to Advanced UNIX! For those of you who
are curious to see what COMS 114 UNIX Tools covers, please
take a look at the web pages for 2004, 2003 and 2002. In
the Advanced UNIX class you will study shell scripting in more
detail, and become familiar with writing scripts to automate everyday
tasks. The goal of this class is for you to become familiar with
writing scripts and gain experience by means of examples. We will cover bash
scripting, basic programming using Perl, and makefiles. See also last
year's class webpage.
Lectures
- Lecture 1: Quick review: the Bash shell
- Lecture 2: Shell expansion and regular expressions
- Lecture 3: Conditionals and tests
- Lecture 4: Loops
- Lecture 5: Functions
- Lectures 6 and 7: Putting it all together
- Lecture 8: Basic Perl Scripting: variables, operators, conditionals, loops, and basic file manipulation
- Lecture 9: Regular expressions in Perl
- Lecture 10: Arrays (scripts: phone.pl,
arrays.pl, and assocarrays.pl)
- Lecture 11: Perl functions (scripts: simple_dictionary.pl,
lstest.pl,
dictionary.pl)
- Lecture 12: Miscellaneous (scripts: lstest1.pl,
max.pl, local.pl)
Homeworks
- Questionnaire.
Hand out: Monday 2/21/05. Due: Monday 2/28/05.
- Homework 1. Hand out: Monday 2/21/05. Due: Monday 2/28/05. IMPORTANT: Deadline
extended to 3/2/05, by 11:59pm!
- Homework 2. Hand out: Friday 3/4/05. Due: Friday 3/11/05.
- Homework 3. Hand out: Monday 3/28/05. Due: Tuesday 4/5/05.
Useful links
- UNIX shells and scripts
- Perl
Useful books
- UNIX Shells by Example (2nd ed), E. Quigley,
Prentice
Hall,2000
- excellent presentation of all five
leading UNIX shells: C, Bourne, Korn, Bash, and tcsh; also covers three
main utilities in UNIX: grep (for searching), sed (for editing), and
awk (for scripting).
- UNIX in a Nutshell, A. Robbins, O'Reilly, 1999
- good general reference, contains alphabetized listing
of
core UNIX commands, and documentation on editors like Emacs, ex and vi,
among others
- Programming Perl (3rd ed), L. Wall, T.
Christiansen,
and
J. Orwant, O'Reilly, 2000
- the standard introduction to Perl
- Mastering Regular Expressions, J. Fried, O'Reilly,
1997
- in-depth presentation of the use of regular expressions
for
manipulating text and data; a special chapter is dedicated to Perl
All books are optional.
Miscellaneous
- 2/21/2005: One of the many links discussing scripting languages (WWW Journal, vol.2, spring '97)
- 2/21/2005: UNIX history as experienced by its creators: Dennis
Ritchie's
webpage
Last modified: April 3 10:00:00 EDT 2005