COMP 2673 – Lab 2 Assignment

 

Goals:

emacs;

Unix commands;

pine;

 

Important: you are encouraged to use keyboards instead of mouse since the buttons and menus are only for xemacs on the Sun machines.

 

Instructions:

 

Steps

Commands and keystrokes

-1. log on to a Sun machine.

password ready

0. open a terminal window.

right click, select Tools and then Terminal

1. copy all the files under the directory ~llin/comp2673/lab2/ to /IntroToCS3 under your home directory.

ls <dir> - list files under a directory

cp <source> <destination> - copy files from one place to another

pwd – show current directory

cd <dir> - change directory

2. open the file haar.c in emacs

two ways to do it:

  1. type the file name from the command prompt;

  2. start emacs first, then select the file.

1. emacs haar.c

or

2. emacs,

    open a file: ctrl-x ctrl-f

    choose the directory and filename

3. add your name at the beginning of the file.

move around:

1. arrow keys

2. Esc f: forward one word

3. Esc b: backward one word

4. ctrl-a: to the beginning of the line

5. ctrl-e: to the end of the line

6. ctrl-v: forward one screen

7. Esc v: backward one screen

8. Esc <: to the beginning of the file

9. Esc >: to the end of the file

4. in the function haarTransform (NOT the whole file), change the variable matrix1 to wmatrix, change the variable matrix2 to tmatrix.

ctrl-s: incremental search forward (enter the word to be searched the first time, and repeat)

ctrl-r: incremental search backward

Esc %: replace query

 - enter the word to be replaced

 - enter the word to be replaced with

 - use space or y to replace and go to the next instance

 - use Delete or n to not replace and go to the next instance

5. remove all the comments in the file (NOT recommended in real life).

delete text:

1. ctrl-d: delete a character

2. Delete: delete previous character

3. Esc d: delete a word

4. Esc Delete: delete previous word

5. ctrl-k: delete a line

 

6. ctrl-x u: undo!

7. save the file.

ctrl-x ctrl-s: save a file

8. use windows: split the window into 2 and move back and forth between them.

ctrl-x 2: split window vertically

ctrl-x o: move to the other window

ctrl-x 0: delete current window

8. exit.

ctrl-x ctrl-c: exit emacs

9. email the file haar.c to your TA

Start pine, in the attachment field, enter the filename along with the full directory, e.g., IntroToCS3/haar.c.