Unix Lab 1

CS 23

Feb. 10, 1997

  1. Log into the Novell network, open the Internet folder on your desktop, and start the telnet program.

  2. Open the Connection menu and choose Open Session. Set the Host Name to keystone and set the Emulator to vt100. Click OK.

  3. After a second or two you should see keystone's login prompt. Enter your user id and password, in turn. Unix is case sensitive, so an uppercase letter in your password must be typed as an uppercase letter. If you make a mistake in typing your user id or password, type a ctrl-u (i.e., press and hold the ctrl key and type a u) to clear the line and start over.

  4. If you're logging on for the first time, you should change your password. Before selecting a password, read the file /usr/local/info/password for advice on choosing a good password:
    less /usr/local/info/password
    
    Use the space bar and b key to move down or up, respectively, a page.

    Use the passwd command to change your password. Assuming that your Novell password is a good password, use that one. If it isn't, don't use it. I run a password cracking program every so often, so if you choose a weak password I'll find out and you'll have to change it.

  5. Run the pico editor on your .cshrc file in your home directory. (You are in your home directory when you first login). Find the part of the file containing setenv commands and add these two:
    setenv PAGER less
    setenv PRINTER ljg35
    
    Save the file and exit from pico. emacs is a much nicer editor, but we'll save that for another day.

  6. This is important to do now so that the two new environment variables are read properly: log out then log back in.

  7. Using the mkdir command, create a sub-directory within your home directory for this lab: unix1. It is a good idea to create a new directory each time you start a new assignment or project, so that you don't clutter up your home directory.

  8. cd to ~kelliher/cs23/unixlab1 and use cp to copy all the files there to the directory (~/unix1) you just created. Note that after typing the u in unixlab1, if you press the Tab key, the rest of the directory name is filled-in for you. This is the shell's file completion feature. emacs has a similar feature. You can use the ls command to list the files in my directory.

  9. You should now be in the directory you created. Using lpr, print the file support.h. If the PRINTER environment variable is set properly, this file will be printed on the laser printer in the lab.

  10. Use less to read through the four files. See pp. 109--111 of Abrahams & Larson or read the man page for help on less.

  11. Note that there are two source code files in your directory. Both of these must be compiled to build the pretest program. Run this command to build the program:
    g++ -o pretest main.cc support.cc
    
    Note that the name of the C++ compiler is g++ and that you should use an extension of .cc for your C++ source code files. The -o switch is used to specify the name of the executable program ( pretest in this case).

  12. Run the program:
    ./pretest data output
    
    Use less to examine the input and output file. Verify that the program does what it's supposed to do.

  13. If there is time, edit main.cc to make the program interactive (i.e., it prompts the user for the names of the input and output files), re-compile, and re-run.

  14. When you're finished, logout from keystone and logout from the Novell network.



Thomas P. Kelliher
Sun Feb 9 15:23:59 EST 1997
Tom Kelliher