CSci 1901: Lab 1, January 18
Lab 1: Intro to Unix and STk
The goals of this week's lab are:
- learn the basic Unix commands to create, save, modify
and run Scheme programs
- learn how to use a text editor
- learn about the Unix directory structure
- learn how to use script to keep a transcript of your work
- run your first simple Scheme programs
Most of this lab will be done as a group with the lab instructors
guiding you through it. This is not typical, but it is an approach that
will be used to quickly bring you up to speed on the basics you will
need for the first real Scheme programming that will be done next
week.
Prerequisites for the first lab:
- initialize your ITlabs computer account. Instructions are at
http://www.itlabs.umn.edu/
If you do not have a ITlabs account, talk to a Lab Instructor
right away.
- attend the first lecture
- read the text through page 20
- read the class web page
- know how to send/receive email
What to do
- Sign up and Find a Lab Partner.
Be sure that you sign up on the sheet that is being passed around. Your
Lab Instructors will explain these. Then find someone who is at about
your experience level and move so that you are at the same machine. (In
order to do this step, you will have to talk to people. So start by
introducing yourself to the people around you, and compare your
computing experience.)
- The guided tour of the Unix operating system.
Your Lab Instructors will now guide you through these items:
- File system hierarchy
- The home directory
- Creating a directory
- Changing directories
- pwd, ls, cd
- Create, edite, and save a file with Emacs.
Your Lab Instructors will now guide you through the emacs editing system.
- Download this .emacs file to your home
directory.
- Move, Copy, and Transcript.
You will learn how to organize your files with mv, cp, rm, and rmdir.
You will also learn how to keep a transcript of your work in a script
file.
- Set up STk.
You will set up your account to use the Stk Scheme system.
To do this type the following commands into a terminal.
module initadd soft/tcl/8.3.4
module load soft/tcl/8.3.4
or edit directly your .cshrc file and add the following line
# load module when you login
module load soft/tcl/8.3.4
Once you are editing the .cshrc file you can add a few more lines:
# prevents core dumps from taking up space
limit coredumpsize 0
# asks for confirmation before removing files
alias rm "/bin/rm -i"
# asks for confirmation before copying or moving files over existing ones
alias cp "/bin/cp -i"
alias mv "/bin/mv -i
- Run STk.
You will create a simple scheme file, load it, and execute it.
Create a file square.scm with the square procedure definition
from page 12 in the text.
Note: Include both your names and your student ID numbers in a comment
at the start of the file. (Comments in Scheme begin at a ';' and continue
to the end of the line.)
Load the file, and compute the square of the numbers your Lab Instructors
will give you.
- Coming and going.
Now log out, and then log back in again. Are your files where you
left them and the the way you left them? Review your script file.
- Show us what you have done.
When you feel comfortable with the items in the steps above, have a
Lab Instructor come over and test you on your capabilities.
- Complete exercises 1.1 and 1.2 from the textbook.
Complete Exercises 1.1 and 1.2 on pages 20-21 of the textbook.
Create a file lab1.scm with the expressions and save the
results in a file called lab1.out.
- Show the exercises to your TAs.
Congratulations for finishing the lab.
Lab 1 total: 10 pts
Next Week
The next lab will be your first "real lab" where you will work on
public key encryption.
Make sure that you are current with your reading prior to the
start of next week's lab.
Copyright: © 2007 by the Regents of the University
of Minnesota
Department of Computer Science and
Engineering. All rights reserved.
Comments to: Maria Gini
Changes and corrections are in red.