Overview
Ling/CmpS 80G is an introductory course in the intelligent use of
computers. While some people (and some software companies) would
have you believe that using a computer intelligently means being
able to use applications (like word processors, spreadsheets, and
email clients, to name a few) without weeping in frustration, this
couldn't be further from the truth. The goal of this course is to
teach you to make a computer do exactly what you want, instead of
training you to only want things done the way the computer does
them! In order to do this, we'll be focusing on the only operating
system good enough for intelligent people like us: UNIX.
UNIX is actually a whole family of powerful operating systems, all
derived from the original UNIX system developed by Bell Laboratories.
Today, computers running some form of UNIX can be found everywhere: as
the backbones of university computing networks (like ours), global
computer networks like the World Wide Web, in your PC at home, and
even on wristwatches. The material taught in this course is
applicable to all of them: including Solaris (found on Sun computers),
Irix (found on Silicon Graphics machines), OS X (found on all newer
Apple machines) and a host of free open-source software systems:
FreeBSD, NetBSD, GNU software, and all varieties of Linux. These
systems are now located everywhere that real people do serious tasks
with powerful machines, and you're going to learn how to use them.
Audience
You should be taking this course if you have little to no real
background in computer systems other than some basic use of word
processors, web browsers, and/or email software. Take it if you're
interested in doing five weeks of concentrated work that will be both
challenging and fun, and will more importantly affect your life by
making you a competent user of the most important class of operating
systems in the world today.
You should NOT be taking this course if you are lazy or
unwilling to do the work, or if you already know so much UNIX that
this will be a review of things you are familiar with. If you're
already navigating directory structures and customising your
.bashrc file, this class will not be exciting for you, and
you won't impress anybody with how much you know. You will hate
yourself for taking it; you will be bored with us, and (even worse)
we'll be annoyed with you.
This class does meet a T2 general education requirement and counts as
a topical course in the Natural Sciences & Engineering area. Computer
Science and Computer Engineering students will benefit from taking
this course, because most courses offered in your major assume a
familiarity with some flavour of UNIX, or that you will pick it up
very rapidly in your spare time. This course teaches UNIX
specifically, and provides access to an array of sophisticated
techniques that will be of enormous value later on, when you are
writing programs. Linguistics and Language Studies students will
benefit from taking this course, because it is a terrific help if you
plan on taking Ling 160 (Computational Linguistics). Finally, this is
an excellent class to take if you've always wondered what the cool
kids talk about at lunch everyday. We'll show you.
Content
To get started, we'll have a look at navigating UNIX directory
structures. You will learn how to get around, look at files, and
perform a few simple tasks. Then, we'll spend some time on HTML (the
language of the World Wide Web) and learn how to create and maintain
web pages. This is important for a number of reasons; the web is a
central part of academic (and normal) life, and setting up a web page
is a great way to learn how to manipulate files' contents with a
text editor (e.g.,
pico,
emacs, or
vi).
Then we'll take a closer look at the language of the 'Bourne Again
Shell' (
bash).
bash is just one of the many command
line interpreters that come installed on all UNIX systems. We'll be
focusing on this particular one for a number of reasons: it is the
default shell on all newer (v. 10.3 and later) distributions of
Apple's "OS X" and most (if not all) distributions of Linux.
Furthermore, most shell scripting (which you will learn how to do) is
done in
bash. The things you will learn include:
- Essential Commands
- creating, copying, editing, moving
and removing files and directories; performing basic operations on
files (like counting words, lines, etc.)
- Combining Commands
- using conjunctions (do this
AND that), and primitive conditionals (do this
ONLY IF that works); sending the output of one
command to another
- Advanced Commands
- pattern matching with the grep
family of programs (e.g., find all the lines in a file foo
that contain instances of my name [Ascander]); automated editing
based on pattern matching (e.g., turn every instance of the word
hell into heck in a file, or, e.g., remove all the
HTML code from a web page, and leave the text behind)
- Shell Scripting
- incorporating UNIX commands in
control structures, which allow one to be extremely
precise about the conditions under which you want commands to be
executed. some of these include: conditionals (e.g., if a file
named to_do exists, show me its contents, and if not, log
me out of my account), loops (e.g., for each file in my directory
that is a text file [i.e., ends in .txt], make a backup
copy of that file), and more.
Requirements & Expectations
Attendance: This part is simple; you have to be here to pass
the class. Make sure that you are free and able to attend every one
of the class meetings. We will only meet ten times this session;
missing a single lecture means that you miss 10% of the course. We
will assume that you are present, bright-eyed, and bushy-tailed at
every class.
Have a CATS account: This is equally simple; you need a CATS
account to be in this class. There is no way for you to do the work
without one, and until you get one, you won't be in the class. If you
need an account, or don't know how to access the one you've got, check
the Information and Technology Services (ITS) web site, at:
http://its.ucsc.edu/services
Homework: There will be a total of nine (9) homework
assignments, which means you'll usually have two per week. They will
be announced on Mondays and Fridays, and due at the beginning of class
on Fridays and Wednesdays. Monday's assignment is due on Friday, and
Friday's is due on the following Wednesday.
Quizzes: There will be at least five (5) in-class quizzes.
These will usually be on Fridays, though not always. Just to keep
things interesting, there will be no set schedule for quizzes, and
spot quizzes may (and probably will) be given without notice.
Final Project: There will be a final project due during the last
week of the course. This is
in liu of a final examination,
which cannot be effectively administered for a course like this. The
final project must be a significant and non-trivial bit of coding,
based on the material taught in class. Needless to say, this is a
very important part of your final grade.
Makeups: There are
NO MAKEUP ARRANGEMENTS for
this course. No late assignments will be accepted, and no quizzes can
be rescheduled. Please don't ask to turn in assignments late; I'll
feel badly for saying no, and you'll feel badly for having asked.
It's a lose-lose situation.
Drop-the-worst: Stuff happens. It is always possible for
someone to have an illness, or accident, family emergency, or
unavoidable absence. For this reason, we will drop
BOTH your worst homework assignment, and your worst
quiz score from the record. If you miss a homework or quiz, your
score on it will be zero; since nothing is worse than a zero, it will
be dropped. This only happens once though; after the first one, all
other zeroes are figured into your grade.
Lab Sections: Lab section attendance is
MANDATORY. Each of you must attend two lab sections
per week. Sections provide your main opportunity to interact with the
instructor (me), who will eventually be giving you a grade. I'm
responsible for guiding you through the course and evaluating your
work (which you must do if you want to pass). This responsibility
cannot be met if you don't go to section. One-on-one help cannot be
provided in lectures, because the purpose of lectures is to provide
you with the tools you need to do the assigned tasks, not walk each of
you through exactly what you're doing right or wrong. If you need
help with the details --- and most of you will --- your lab section is
the ideal time to get this help. It is
YOUR
responsibility to make sure you go.
Books
There is
NO required textbook for this class. However,
you will benefit immensely from owning one or more of the following:
An excellent beginner's approach to the UNIX operating
system:
Learning the Unix Operating System (O'Reilly & Associates,
ISBN: 1-56592-060-0)
A compact and thorough reference book:
Unix in a Nutshell: System V Edition (O'Reilly & Associates,
ISBN: 1-56592-001-5)
A large and comprehensive reference book:
Unix Power Tools (O'Reilly & Associates,
ISBN:
0-59600-330-7)
All of these books are available at any online book-seller
(for instance,
amazon.com).
Typically, you won't need to bring a book to class, but you will very
likely need to peek inside one while doing your homework --- or a
take-home quiz.
A Note on Cheating
There is zero tolerance for faking the funk in this course. If any
kind of plagiarism or dishonesty is detected in your work, you will be
removed from the course, your grade will be
F,
and you will be reported to your College Provost; no exceptions.
Cheating is turning in work that is not your own: whether you copied
it from another student, off of the Internet, etc. We have ways of
catching dishonest students, so please don't try it. Cheating is a
waste of everybody's time; yours because you're not actually
LEARNING anything, and ours because we're not actually
TEACHING you anything. Cheat at cards, cheat on your
significant others if you must, but do not cheat in this class.
Calendar
- Week 1:
- Files and directory structure/manipulation; pathnames; standard
input & output; text editing; web browsers; HTML
- Week 2:
- Unix utilities; reporters, fixers & filters; wildcards and
filename abbreviations; pipelines; command coordination and
redirection
- Week 3:
- Regular expressions and the grep family of programs;
stream editing with sed
- Week 4:
- Variables and values; basic shell scripting; 'if' loops; reading
input from STDIN; switches
- Week 5:
- Advanced shell scripting; 'while' and 'for' loops; functions;
recursion; script debugging and testing