Faculty of Applied Science and Engineering, University of Toronto
CSC181: Introduction to Computer Programming, Fall 2000

Practical 1: Getting to Know the ECF Lab

Introduction

The purpose of this practical is to familiarize you with the ECF lab.

You will not be graded for this practical, but it is important that you do the small exercises below in order to become comfortable with the software tools available to you on ECF, which you will need in order to complete your assignments in this course.

Experienced computer users can probably complete this practical very quickly.

Your Tasks

1. If you are in the lab, find a working, available computer, or if you are working from home, telnet to ecf.toronto.edu. Log in. If you do not know your username and/or password, type getname when prompted for your username and just press Return if it asks you for your password. This will run a program which prompts you for some information and then reports your username and initial password.

2. Change your password by typing passwd.

3. Try reading your e-mail using Pine (pine). Also try using Pine to read the course newsgroup, ut.ecf.csc181. (Please do NOT post a test message to the newsgroup.)

4. To create and modify your computer programs you will have to use a text editor. Three examples of text editors are Pico (pico), Emacs (emacs) and vi (vi). Pico is probably the easiest of these to use.

To find out more about Pico, you can type man pico. Similarly you can learn more about Emacs and vi by typing man emacs and man vi, respectively.

5. Type pico hello.c to begin editing hello.c. Type in the following C source code, save it to hello.c, and exit Pico.

main() {
    printf("Hello, world!\n");
}

6. Type cat hello.c to see your new file. To see a list of your files so far, type ls.

7. Compile the source code by typing cc hello.c. If you do not get any error messages, you will now have a compiled program called a.out. Type ls to check.

8. Run your program by typing ./a.out.

9. Run your program again, but this time type ./a.out > out to redirect the program's output to a file called out. To examine this file's contents, type cat out.

10. Try using the ECF electronic submission program with your source file hello.c and output file out. First, read the documentation for this program by typing man submit. Then:

  • Submit hello.c and out to your Assignment 0 submission folder.
  • Check the contents of your Assignment 0 submission folder.

11. Use man to find out more about the following commands: less, rm, mv, mkdir, rmdir. If you have not already done so, you should also look at the guide Getting Started With UNIX, a printed copy of which is available from SFB540 for the nominal fee of $2.


CSC181 Home Page | Last updated on 2000-09-12 by Ray Ortigas.