Preparing a script

You will usually be asked to provide a script file that records you compiling and running your files. Here are the steps to take:

  1. First, remove the compiled (.class) versions of your files, using the rm command. If you want to get rid of all of the class files, you can use the command
    rm *.class
    
    You'll have to be more judicious if you were provided some class files that you need to keep.
  2. Now, start recording by giving the command
    script
    
    Everything that goes to your terminal will now also be recorded in the a file named typescript.
  3. List the directory, with long details:
    ls -l
    
  4. Compile your files. You might compile them one by one, or you could do
    javac *.java
    
  5. Run each program with inputs that have been chosen to show that your program works for a representative set of cases. Include the tricky cases.
  6. End the script with the command exit.
  7. Clean up the script with the command
    /cslab/class/csci235/bin/cleanscript typescript > typescript.clean
    

Printing a program and scripts

Be sure that you have cleaned up your script files. Then decide what files you should print and in what order. You can print them all with
a2ps --file-align=fill filenames ...
Some useful options for a2ps include:

Handing in files electronically

To turn in a lab or project electronically, use the command:
/cslab/class/csci235/bin/handin labname filenames ...
The labname (or project name) will be specified in the assignment. Include all of the files (usually Java source and a typescript) on a single command. Be sure that you see the report of successful submission. You can submit more than once; the last submission can always be found.

Copying work between accounts

You may want to copy files between an in-lab account and your personal account, or you might want to copy files to/from a partner's account. A fairly easy way to do that is to use the file browser and SSH.

In these examples, we'll assume that you are logged in under one of the accounts, and that the other account that you want to copy to or from is named msnerd; substitute yours.

  1. In the Places menu (in the top bar), select Home folder to open a window. Browse to the folder/directory in this account where you want to copy.
  2. Again, in the Places menu, select Connect to server. In the dialog that pops up,
    • Change Service type to SSH
    • For Server, fill in cslab25 (or any of the other cslab machines)
    • For Folder fill in /homes/msnerd (but with the correct username)
    • For User name fill in msnerd (yours)
    • Click on Connect
    • When prompted, supply the password for msnerd, but be sure that the "forget immediately" option is chosen.
    All that effort gets you another browser window, but this one is for the home directory of msnerd.
  3. Navigate in this new window to where you want to put/get the files. You may want to make a new folder for just this lab.
  4. Use the mouse to select the files you want in one window and copy them to the other.

When you're done, disconnect the other home directory. (Don't just close the window.)


Cary Gray
Last modified: Tue Sep 14 11:16:21 CDT 2010