.ds F1 - % -
.ds Fd  ~
.ds Fr  ~
.ds H1  ~
.ds Hl MP119
.ds Hr Introduction to Unix
.bp
.PH "~~~~~~~~~~~~~Final~Exam~Key"
.sp
.E1
.L1 5 2 1
To halt execution of a command, depress the
.I rubout
key.
.L1
The "#" and the "@" are used for
.I "making corrections."
.L1
.I "remind mmw 12:00 am +3 -r you have a meeting"
is the command which could be used to remind you of a meeting scheduled
for 12 O'clock noon, three months from now.
.L1
.I "cat j1 j2 j3 > save "
will copy three files j1, j2, and j3 into a file called save.
.L1
.I "cat junk >> junk2  "
will append  the file , junk, to the file junk2.
.sp
.ti -3
.L1
.L2
cat junk__will display the file junk on the terminal unformatted.
.L2
pr junk___will display the file junk on the terminal formatted
with a header line.
.L2
opr junk__will display the file junk on the line printer, unformatted.
.E2
.L1
.I "rm [a-c]*"
will remove all files from  your directory which begin with a, b, or c.
.L1
.I "chmod 700 junk"
will change the mode of the file junk, such that only the owner has read,
write, and execute  priviledges.
.L1
.I "split -1500 junk"
.br
.I " opr xaa"
.br
.I "opr xab"
.sp
will obtain a paper listing of the file junk which contains 3,000
lines of text.
.L1
.I "grep -v '.$' junk|opr"
will obtain a paper listing of all lines of text in the file, junk,
which do not end in a period.
.L1
.I "grep -c '^a' junk"
will determine the number of lines of text in junk which begin
with an "a".
.L1
The parent directory of "d" is
.I "B."
.L1
.I "/u3/A/B/D/D2"
will be displayed if %pwd is issued.
.L1
.I "cd D/D2"
will transfer you from "B" to "D2".
.L1
.I "mv /u3/A/C/F/junk junk"
will copy and delete the file junk from directory "F".
.L1
.I "opr /u3/A/C/F/temp "
will obtain a paper listing of the file temp located in directory "F".
.L1
.I "ls -l /u3/A"
will list the files in the login directory.
.L1
.I "mkdir /u3/A/C/F/F1"
or
.I "cd F; mkdir F1"
will make a subdirectory  "F1" in directory "F".
.L1
.I "rmdir D/D1"
or
.I "cd D; rmdir D1"
will delete the directory D1.
.L1
.I "g/unix/s//UNIX/gp"
will change all occurrences of unix to UNIX and display the corrected lines.
.L1
.I "/software/
.br
.I "//"
.br
.I "s/software//"
.sp
will delete the 2nd occurrence of software.
.L1
.I "/Such/s/./,who may be carrying out different tasks."
.sp
will insert the clause "who may be carrying out different tasks" following
"users."
.L1
.I "a"
.br
.ul 2
Furthermore the UNIX system includes very effective tools
for writing software.
.br
.I \&.
.sp
will append the above sentence to the end of the file.
.L1
.I "0a"
.br
.I
The Unix family has greatly increased the flexibility of the
operating system.
.R
.sp
will place the above sentence at the beginning of the file.
.L1
.I "6,10w part"
will create a file called part consisting of lines 6 - 10 of success.
.L1
.I "$-2,$d"
will delete the last 3 lines of success.
.L1
.I
w part
.br
e success
.br
1,$ s/$/$/
.R
.sp
will place a "$" at the end of each line.
.L1
.I "0r part"
will prepend the file "part" to success.
.L1
.I "nroff -o10-40 missile|opr"
will obtain a paper listing of pages 10 - 40 of the file, missile.
.L1
.I "\&.ds CS DELETE NEXT LINE"
and
.I "\\*CS"
will define and execute the character string, CS.
.L1
.I
\&.de FM
.br
\&.ro
.br
\&.tl '\\n(mo\\n(dy\\n(yr''page %'
.br
\&..
.br
\&.wh 0 FM
.R
.sp
will display the current date and page number in lower-case Roman
numerals at the top of each page.
.ne 8
.L1
The student's answer should resemble the following:
.nf
________________________________________________
|           Table of Contents                   |
|                                               |
|1. Book I                                 1    |
| 1.1 Chapter 1                            1    |
| 1.2 Chapter 2                            1    |
|                                               |
|2. Book II                                     |
|                 -i-         (current date)    |
|_______________________________________________|
.fi
.L1
.I
\&.ta 1, 15, 30, 45
.br
\&.fc /
.br
/John, Doefield//226-50-0422//GS11/
.R
.sp
will place the above text in columns 1, 15, 30, and 45.
.L1
.I
\&.de re
.br
\&.tl ''RETENTION DATE: \\$1''
.br
\&'sp 5
.br
\&..
.br
\&.re 12/22/78
.R
.sp
will display the heading centered at the top of the first page and leave
5 blank lines following the heading.
.L1
.I
\&.so /usr/lib/tmac.nm
.br
\&.ds F1
.br
\&.ds CL CONFIDENTIAL
.R
.sp
will suppress the page numbers automatically printed, and display
"CONFIDENTIAL" at the top and bottom of each page.
.L1
.I
\&.PH "" 0 0 0 0 1
.R
will number paragraphs in a file in Arabic notation. [Note: This answer
is correct so long as the sixth arguement to the macro is "1." The
preceeding five arguements can assume any value.]
.L1
.L2
\&.ul 5--will underline the next five lines.
.br
.L2
\&.E1  --signifies the end of level one text.
.br
.L2
\&.PP  --will begin a paragraph and indent the first line by 8 spaces.
.br
.L2
\&.ti 10-will indent the next line by 10 spaces.
.L2
\&.ti+10-the next line will be indented by 10 space plus the number of
spaces in the current indent.
.E2
.L1
MP168 is an introductory course on
.I "Unix"
for the novice.
will be displayed.
.L1
.I
\&.PH "Unix Commands" 0 0 0 2 I
.br
\&.L1 0 1 A ~.~~
.br
Inter-User Communication
.br
\&.L2 8 1 1 ( )~~
.br
write
.br
\&.L2
.br
msg
.br
\&.L2
.br
sndmsg
.br
\&.E2
.br
\&.L1
.br
Utility
.br
\&.L2
.br
who
.br
\&.L2
.br
where
.br
\&.L2
.br
news
.br
\&.E2
.br
\&.E1
.R
.sp
.L1
.I
1.  <text>
.br
2.  <text>
.br
3.  <text>
.R
.L1
.I "editor +junk 20 5;"
will bring junk into the editor as an alternate file with line 20
at the top of the window and the 5th character as the first character
of each line.
.L1
.I
<break>
.br
 50
.br
<scroll down>
.R
.sp
will display the 50th previous line or the begining of the file.
.L1
Line 150 will be displayed as the current line.
.L1
The alternate buffer holds the most recently deleted text.  It may be
referenced by:
.I "<break>, <PUT> <F4>"
.L1
The
.I  PICK and PUT <F3 and F4>
function keys are used to reposition text within a file.
.L1
.I
<break>  GO TO <F7>
.br
<break>  text
.br
-SEARCH <F6>
.R
.sp
would be typed to locate the word "text", which is located near the
end of the file.
.L1
.I
<position cursor under line 1> <or type GO TO and then HOME>
.br
<break> 10
.br
<DEL LINE>
.R
.sp
would be typed to delete the first 10 lines from the file.
.L1
The MAKE PORT <ctrl z> function allows you to view more than one  file
simultaneouly.
.L1
.I
<break> 2
.br
ENTER <ctrl c>
.R
.sp
would be used to make the 2nd file the current file.
.L1
.I
1. type GO TO and then HOME
.br
2. <break> 10 PICK
.br
3. <break> temp USE
.br
4. position the cursor in temp where the lines are to be inserted.
.br
5. PUT <F4>
.R
.sp
will copy 10 lines from the current file to file "temp".
.E1
