.bp 1
.af % 1
.ds F1 - % -
.ds F1 - % -
.ds Fd
.ds F3  ~
.ds Fl  Course~Management~Manual
.ds Fr  Not~For~Student~Use
.ds H1  ~
.ds Hl MP119
.ds Hr Introduction to UNIX
.tl ''COURSE~MANAGEMENT~MANUAL''
.tl ''MP-119''
.tl ''INTRODUCTION TO UNIX''
.sp 2
.PH "Course Organization:" 5 2 2 3
.PP 5
The course is self-paced and designed to be taken either
individually or in a group environment.
.PP
The following four student manuals (Units I-IV) constitute the
entire  learning package:
.sp 2
.in 17
.ti -11
UNIT~I~~-~~Gaining access to Unix;Inter-User Communication;
File Manipulation and Utility Programs
.sp 2
.ti -11
UNIT~II~-~~Internal Structure; Manipulatory Directories
.sp 2
.ti -11
UNIT~III~-~UNIX Text Editor; nroff; Text Formatting
.sp 2
.ti -11
UNIT~IV~-~~The RAND Editor
.in -17
.PH "Progress Checks:"
.PP
The student takes a Proficiency Test at the conclusion of each of the four
UNITS of instruction. The Answer Keys for these Proficiency Tests are
attched. A referral to the section of the text where the relevant issue
is discussed is provided for each answer. The tests themselves are to be self-
graded to measure the student's retention and comprehension of the
subject matter.
.sp
.in 5
Unit I~~-~~21 fill-in the blank questions/answers
.sp
Unit II~-~~10 fill-in the blank questions/answers
.sp
Unit III~-~25 fill-in the blank questions/answers
.sp
Unit IV~-~~20 fill-in the blank questions/answers
.in -5
.PP
In the answer keys which follow you will find a refernce to the
section in which the answer is found as well as the exact page number.
The is intended to be of use to the course manager in aiding
students who are experiencing problems.
.ne 10
.PH "FINAL EXAMINATION:"
.PP
The final examination consists of 50 fill-in the blank type questions.
It shall be administered by the Learning Center Monitor. The Final
Exam Answer Key is attached. A score of 70% (35 correct out of 50 responses)
is required to receive a passing grade in this PASS/FAIL course.
.PH "ASSISTANCE AND QUESTIONS:"
.PP
Questions and comments should be directed to Mr. John Cashour, E22
Software Design and Development on 8955(s).
.PH "Additional Sources" 5 2 2 3
.PP 5
The material which is presented in MP119 is only an overview of the
facilities that are currently available on the UNIX system. For
information concerning the more esoteric and less widely used aspects
of the system, one must consult the various manual sources.
.PP
On the topic of the UNIX Editor, two sources are currently available:
"A Tutorial Introduction to the UNIX Text Editor" and "Advanced Editing
on UNIX." Both are included in
.I "Documents for the PWB/UNIX Time Sharing System"
(sections B.3 and B.4 respectively).
.PP
For additional information on NROFF and the NM macro package consult the
following sources: "NROFF/TROFF User's Manual," "A TROFF Tutorial,"
"MNM-Macros for Formatting Informal Documents" and "User's Guide to the 'NM'
Macros"(PIB-78-006). The NROFF/TROFF items can be found in the
.I Documents.
The first of the macro items mentioned above forms a part of the
.I "PWB/UNIX User's Manual"
(Supplement, section 7, MNM [VII], pp. 1-6).
The "User's Guide" is on line, a copy can be obtained from your UNIX system
administrator. One more item of interest concerning NROFF is the relevant
section in the
.I "PWB/UNIX User's Manual"
(listed alphabetically in section 1 - PWB/UNIX I).
Finally, for more information on the Rand Editor consult the following:
"The CRT Text Editor NED - Introduction and Reference Manual."
.PP
A few comments on the organization of the
.I "PWB/UNIX User's Manual"
would appear to be in order.
The "User's Manual" is divided into the following eight sections:
.L1 15 2 I
Commands and Application Programs
.L1
System Calls
.L1
Subroutines
.L1
Special Files
.L1
File Formats and Conventions
.L1
Games
.L1
Miscellaneous
.L1
System Maintenance
.E1
.sp
Each of these sections consists of a number of entries of several pages
in length. Within each section entries are organized alphabetically
according to entry name, which appears in the upper right-hand corner.
Supplements to the manual are integrated into the proper section.
.PP
All of the materials discussed above should be obtainable from your
system administrator. If not, DOD-FT. Meade users are advised to
contact Mr. Joseph Clemmons.
.PP
If you have a UNIX question and none of the above sources can provide an
adequate answer, it's time for you to consult your local UNIX guru.
.bp
.PH "Answers to Unit I Proficiency Test" 5 2 2 3
.sp
.L1  5 2 1
Information is sent to the computer one line at a time. (See the
explanation of the return key under "The Keyboard.")
.L1
To halt execution of a command, depress the
.I RUBOUT
key. (See the explanation of the rubout key under "The Keyboard.")
.L1
Corrections are made to an input line before the  RETURN key
is depressed. (See the explanation of the return key under "The Keyboard.")
.L1
The command to change your password is :
.I "%passwd"
(See the example under "Changing Passwords.")
.L1
The
.I "msg"
program is used to read a message that has been sent to you.
(See the explanation of the command given in "Reading your Mail.")
.L1
.I "sndmsg"
is the command used to send messages to other users. (See the explanation of
the command given in "Sending Messages.")
.L1
The
.I "write"
command can be used to conduct a two-way conversation. (See the explanation
of the procedure under "Write Command.")
.L1
remind mmw +3:00 -r"you have a meeting"
.br
---------------------------------------
.br
(See the section entitled "Write Command.")
.L1
.The
.I "cat"
command is used to create a file, display a file, and append one
file to another file. (See the sections entitled "Creating Files,"
"Copying Files," "Cat Command," "Concatenating Files," and "Appending
Information.")
.L1
The command,
.I "%cat j1 >> j2"
will append j1 to j2. (See the example in the section entitled "Appending
Information.")
.L1
.I "pr junk|opr"
will print the file junk on the line printer with header lines.
(See the section entitled "The Opr Command as a Filter.")
.L1
.I "pr -t j1 j2 | opr"
or
.I " cat j1 j2 | opr"
will print the files j1 and j2 without header lines.
(For an explanation of the first alternative see the description of the -t
option under "The Print Command."  Use of the second alternative is
described in the section entitled "Concatenating Files>")
.L1
.I "rm [a-h]?"
will delete all files beginning in a-h followed by any
single character. (See the consideration of the ? and [...] wildcards
in "Filenames and Wildcards" and the discussion of the rm command
in the section entitled "Deleting Several Files.")
.L1
.I "ls -r *bak"
will display all files ending in "bak" in descending order.
(See the discussion of the * wildcard in "Filenames and Wildcards"
and the explanation of the ls command in the section entitled
"Listing Filenames.")
.L1
The
.I "cmp and diff"
commands are used to compare files. (See the explanation of these two
commands in the section entitled "Comparing Files.")
.L1
The command
.I "%chmod 70 junk"
will give read, write, and execute priviledges to the owner's
group, and will remove all priviledges for all other
users of the file. (See the explanation of the chmod command in the section
entitled "Chmod Command.")
.L1
.I "%grep -c -v '\e.$' junk"
will display the number of lines in the file, junk, not
ending in a period. (See the explanation of the grep command, its options
and the use of expressions with the command in the sections entitled
"Searching a File" and "Expressions.")
.L1
.I " %sort -t/ -r -n +3 junk|opr"
will sort by fields in descending order and route to the printer.
A numeric sort is performed on the 4th field; and the '/' is the
field delimiter. (See the explanation of the sort command and its
options in the sections entitled "Sorting Files" and "Sort Options.")
.L1
.I "%sort -a junk|pr -h secret"
will sort the upper-case and lower-case letters separately. The
output will contain a header with the classification 'secret'
instead of the filename. (The portion of the command to the left of the
pipe is described in the section entitled "Sort Options." The other part of
the command (to the right of the pipe) is described in the section entitled
"The Print Command.")
.L1
.I "%split -1000 junk"
will segment junk into files containing 1000 lines each; the files
will be named: xaa, xab, xac, etc. depending on the size of junk.
(See the section entitled "Segmenting a File" for an explanation of how
the split command is used.)
.L1
.I "grep 'ach' junk|sort|opr"
will search the file junk for the word "ach", form a file
containing these lines, sort them, and print them on the
line printer. (Use of the grep command is explained in the section entitled
"Searching a File." The use of the sort command as a filter is described
in a note at the conclusion of the section entitled "Sort Options." The use
of opr as a filter is explained in "The Opr Command as a Filter.")
.E1
.bp
.PH "Answers to Unit II Proficiency Test" 5 2 2 3
.sp
.L1
The login directory is
.I "/u3/A"
(See the section entitled "Directories.")
.L1
The pathname used to reference directory 'D' is
.I " /u3 /A/B/D."
(See the explanation of pathnames in the section entitled "Pathnames.")
.L1
.I "% ls /u3/A/C/F"
is the command used to list the filenames in directory 'F'.
(See the section entitled "Pathnames" for an explanation of how the ls
command is used with pathnames.)
.L1
.I "% cat /u3/A/B/E/G"
junk is the command used to display the file 'junk'
in directory 'G'. (Refer to the examples in the section entitled
"System Directories.")
.L1
The command used to create a directory is
.I "mkdir."
(An explanation of the mkdir command is given in the section entitled
"Creating Directories.")
.L1
The command used to transfer from one directory to another is
.I "chdir  or   cd."
(An explanation of the chdir command is given in the section entitled
"Changing Directories.")
.L1
The command used to delete a directory is
.I "rmdir."
(Use of the rmdir command is explained in the section entitled
"Removing Directories.")
.L1
.I "Yes "
you can reference another user's files without transferring to that
user's directory.  The advantage in transferring to that user's directory
is to simplify the forming of commands by not having to specify the full
pathname each time a file is referenced. (An explanation of the
advantages of transferimg to another user's directory as opposed to merely
displaying his files is given in the section entitled "Transferring to
Another's Directory.")
.L1
.I "The mv  and  cp "
commands are used to copy files from one directory to
another. (The cp and the mv command are described in the sections entitled
"Transferring Files" and "The Move Command" respectively.)
.L1
You would use the 'mv' command if the file to be copied is also to be
deleted. (The deleting feature of the mv command is described in the
section entitled "The Move Command.")
.L1
/u3/A/B/E/G/H
(Use of the pwd command is explained in the section entitled
"Print Working Directory")
.L1
cp /u3/A/C/F/junk junk
(The method of copying files is explained in the section entitled
"Copying Files.")
.L1
chdir /u3/A/B/E
(Transferring from one directory to another using the chdir command is
described in the section entitled "Changing Directories.")
.E1
.bp
.PH "Answers to Unit III Proficiency Test" 5 2 2 3
.sp
.L1
ed junk
.br
a
.br
I am a junk file. I'm used for
.br
testing commands.
.br
\&.
.br
w
.br
1,$p
.br
q
(The use of the above commands is explained in the following sections:
"Ed Command," "Creating a File," "The Quit Command," and
"Printing the Contents of the Buffer.")
.L1
-3,-1p or .-3,.-1p will display the 3 previous lines of text.
-3p will display the text 3 lines before the previous line.
(For an explanation of the techniques for displaying lines of a file
see the section entitled "Displaying a Single Line.")
.L1
\&.=, is used to determine the current line.
(This command is introduced in the section entitled "The Current Line.")
.L1
g/\\$/s///gp, will delete all $'s from the file
(For an explanation of "s" see "The Substitute Command." The "g" command
is described in the section entitled "The Global Command.")
.L1
"i" inserts text before the indicated or current line.
.br
"c" will change the text on the indicated lines to the specified
text.
.br
"m" will delete text from one place and insert it just after
the indicated line.
(For an explanation of the above commands see the sections entitled
"The Insert Command," "The Change Command," and "The Move Command"
respectively."
.L1
The  command "3a" will append text following the 3rd line in the
buffer.
(See the explanation of a in the section entitled "The Append Command.")
.L1
The command "250w junk" will create the file junk consisting of
line 250 of the current file.
(Use of the w command in this fashion is described in the "Advanced Features"
section under the heading "The Write Command.")
.L1
The command "e junk" will read the file, junk, into the buffer,
destroying the current contents.
(The characteristics of the e command are described in the section entitled
"The Edit Command.")
.L1
The command, s/.*/(&)/p, will enclose the current line within
parentheses, and display the line.
(The characteristics of .* are described in the section
entitled "The Repetition Character."  The features of & are described in
"The Line Repeat Character." The procedure for substituting is described in
the section entitled "The Substitution Command.")
.L1
"nroff -o8-20 junk" will display pages 8 thru 20, stopping
after each page until the Return key is depressed.
(Use of the nroff command and its arguements are described in the section
entitled "Introduction to Nroff.")
.L1
The Nroff program is used for formatting files.
(This basic idea is conveyed in the section entitled "Introduction
to Nroff.")
.L1
The command ".pn 8" will number the first page 8.
(The pn command is presented in the section entitled
"Page Control Formatting.")
.L1
The  command ".ul" will underline the next line.
(The ul command is presented in the section entitled
"Underlining Text.")
.L1
\&.ds cs This is a characer string
.br
\\\\*(cs
.br
will define and display the character string, cs.
(Character strings are covered in the section entitled
"Defining Character Strings.")
.L1
\&.de mo
.br
\&.tl '\\\\$1 '' \\\\$2'
.br
\&..
.br
\&.mo "user's name" "user's group"
.sp
will define and display the macro, mo.
(The definition and display of macros via arguements is covered
in the section entitled "Arguements.")
.L1
The command ".ti 10" will indent the next line of text by
10 spaces.
(The ti command is presented in the section entitled "Automatic Indenting.")
.L1
~~~
.L2
".br" will begin a new line on the next line, whereas ".sp"
will leave a blank lne and then begin a new line.
.L2
".ls" only needs to be specified once to cause blank lines to
be inserted between lines of text, whereas, ".sp" must be
specified before each line.
.L2
".ad c" will center with line filling, whereas, ".ce" will
center with no line filling.
.E2
.nf
~~~~~(The above three commands are covered in the sections en-
~~~~~titled "Text Placement Control," "Adjusting Output Lines"
~~~~~and "Vertical Spacing.")
.fi
.L1
~~
.L2
".ta 10 20 30 40 " sets up tab stops to be evey 10 positions.
.L2
".tr aA" will display a capital A wherever a lower-case A
appears.
.E2
.nf
~~~~~(The procedure for setting tab stops is covered in the
~~~~~section entitled "Defining Tabs." Use of the tr command
~~~~~is explained in the section entitled "Character Trans-
~~~~~lation.")
.fi
.L1
The current date and page no, will be displayed right-adjusted
at the top of each page.
(The procedures for setting headers is covered in the section entitled
"Headers.")
.L1
The given heading structure is produced by the following series of commands:
\&.P1 Book~I
.br
\&.P2 Chapter~I
.br
\&.P3 Verse~I
(Use of the numbered paragraph macro is described in the section
entitled "Outline Style Paragraph Headings.")
.L1
 07/28/80                                    page 1
.br
		     John Johnson
.br
		     E53  x8007

(The header macros are covered in the section entitled "Headers.")
.L1
		       Unclassified
.br
			   |
.br
			   |
.br
			   |
.br
  Jan. 1980
.br
		       Unclassified
(The classification macro is presented in the section entitled
"Generating Classifications." The use of footers is described in the
section entitled "Footers.")
.L1
".I" can be used to underline portions of a line, an entire line,
or several lines, whereas, ".ul" can be used to underline only
an entire line or several lines.
(Underlining with the I command is covered in the section entitled
"Underlining.")
.L1
~~~
.L2
".PP 5" will begin a paragraph with the first line being indented
by 5 spaces.
.L2
\&'PH "EM MACROS" 0 2 2 2' will generate a paragraph with an underlined
heading.  The paragraph will not be indented, but will be preceded and
followed by 2 blank lines.
.E2
.nf
~~~~~(The PP and PH macros are presented in the sections entitled
~~~~~"Paragraph Formation" and "Paragraph Headings" re-
~~~~~~spectively.)
.fi
.L1
\&.L1 "" 1 I "" .~~
.br
AAAAAA
.br
\&.L2 "" 1 A ( )~~
.br
BBBBBB
.br
\&.L2
.br
CCCCCC
.br
\&.E2
.br
\&.L1
.br
DDDDDD
.br
\&.L2
.br
EEEEEE
.br
\&.L3
.br
FFFFFFF
.br
\&.L3
.br
GGGGGG
.br
\&.E3
.br
\&.E2
.br
\&.E1
.E1
.E2
(The list macros are presented in the section entitled "Forming Outlines.")
.bp
.PH "Answers to Unit IV Proficiency Test" 5 2 2 3
.sp
.L1
.I "e junk 20 5,"
will invoke the Rand editor with junk being the current file.
Line 20 will be the first line of text displayed; and each
line will begin with the 5th character.
(The editor command is presented in the section entitled
"The Editor Command.")
.L1
.I "<ctrl B> or USE"
is used to transfer from the current file to an alternate file.
(The USE function is described in the latter part of the section
entitled "Copying and Repositioning Text.")
.L1
.L2
.I "<scroll up>"
will advance the window 10 lines or approximately half the screen.
.L2
.I "<break> 15 <stroll up>"
will advance the window 15 lines.
.L2
.I "<next page>"
will advance the window 22 lines or to the next page.
.E2
.nf
~~~~~(The scroll up function is described in the section entitled
~~~~~"Scanning a File." The next page function is presented in the
~~~~~section entitled "Paging.")
.fi
.L1
The
.I "<F2> or PORT=>"
function would be used to view text that extends beyond the edge of the
screen.
(The port function is described in the section entitled
"Scaning a File.")
.L1
.I "<break> 10 <F1> or <break> 10 PORT<="
will shift characters 10 positions to the right.
(This feature of the port command is described in the section entitled
"Scanning a File.")
.L1
.I "<break> 230 <F7> or <break> 230 GO TO"
will display line 230 of the current file as the current line.
(Use of the GOTO function in this manner is described in the section
entitled "More on Scanning.")
.L1
The
.I "RUBOUT"
key terminates the editor.
(The use of RUBOUT to exit the editor is covered in the section
entitled "Leaving the Editor.")
.L1
.I "junk.bak"
will be assigned to the unmodified version of junk.
(The topic of backup files is covered in the section entitled
"Leaving the Editor.")
.L1
The
.I "<home>"
key is used to move the cursor to the top of the page.
(The characteristics of the HOME key are covered in the section
entitled "Modifying a File.")
.L1
The
.I "ins char"
key is used take the terminal out of the insert mode.
(The INS CHAR key is covered in the section entitled
"Inserting Text.")
.L1
.I "<break> 10 <ins line>"
would be typed to insert 10 blank lines into a file.
(Use of the INS LINE key with BREAK is described in the section entitled
"Inserting Text.")
.L1
To delete all characters following the 10th character on a line,
you would position the cursor under the 11th character, hit <break>,
move the cursor at least one position past the last character on the line
and then hit the <del line> key.
(This procedure for "selective deleting" is described in the section
entitled "Other Options.")
.L1
.L2
.I "<F3> or PICK"
is used to place data into the PUT buffer.
.L2
.I "<F4> or PUT"
is used to place data back into the file from the PUT buffer.
.L2
.I "<F5> or + SEARCH"
is used to perform a forward search.
.L2
.I "<F6> or - SEARCH"
is used to perform a backward search.
.E2
.nf
~~~~~(The PICK and PUT functions are described in the section
~~~~~entitled "Copying and Repositioning Text." The SEARCH keys
~~~~~are pressented in the section entitled "Searching a File.")
.fi
.L1
.I "<break> <F4> or <break> PUT"
causes data from the alternate buffer to be placed back into the
file.
(This procedure is described in Note #2 of the section entitled
"Copying and Repositioning Text.")
.L1
.I "deleted data"
is placed into the alternate buffer.
(The nature of the alternate buffer is described in the section entitled
"Copying and Repositioning Text.")
.L1
.I "<ctrl z> or MAKE PORT"
allows you to view several files simultaneously.
(The MAKE PORT function is described in the section entitled
"Manipulating Files Siultaneously.")
.L1
.I "<break> 3 <ctrl c> or <break> 3 ENTER"
would be used to reference the file in the 3rd window.
(Referencing windows is covered in the section entitled
"Manipulating Files Simultaneously.")
.L1
.I "<break> <ctrl z> or <break> MAKE PORT"
is used to remove the smaller windows from the screen.
(This procedure for removing windows is covered in trhe section
entitled "Manipulating Files Simultaneously.")
.L1
.I "<break> junk <ctrl v> OR <break> junk SAVE"
will make a copy of the current file as junk.
(The use of the SAVE function to rename a file is covered in the final
lines of the section entitled "Manipulating Files Simultaneously")
.L1
.I "<break> <F7> or <break> GO TO"
is used to branch to the end of a file.
(This function is described in the section entitled
"More on Scanning.")
.E1
.bp
.PH "Final~Exam~Key"
.L1 5 2 1
To halt execution of a command, depress the
.I rubout
key.
(See the Rubout entry in the section entitled "The Keyboard"
- UnitI, ModuleI)
.L1
The "#" and the "@" are used for
.I "making corrections."
(See the section entitled "Special Characters" - UnitI, ModuleI)
.L1
.I "remind mmw /+3 12:00am -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.
(See the section entitled "Remind Command" - UnitI, ModuleII)
.L1
.I "cat j1 j2 j3 > save "
will copy three files j1, j2, and j3 into a file called save.
(See the section entitled "Concatenating Files" - UnitI, ModuleIII)
.L1
.I "cat junk >> junk2  "
will append  the file , junk, to the file junk2.
(See the section entitled "Appending Information" - UnitI, ModuleIII)
.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
.nf
~~~~~(See the sections entitled "Cat Command," "The Print
~~~~~Command" and "Off line Print" in UnitI, Module III.)
.fi
.L1
.I "rm [a-c]*"
will remove all files from  your directory which begin with a, b, or c.
(See the section entitled "Deleting Files" - UnitI, ModuleIII)
.L1
.I "chmod 700 junk"
will change the mode of the file junk, such that only the owner has read,
write, and execute  priviledges.
(See the section entitles "chmod Command" - UnitI, ModuleIII)
.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.
(See the section entitled "Segmenting a File" - UnitI, ModuleIV)
.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.
.tr #^
(See the section entitled "Searching a File" - UnitI, ModuleIV)
.L1
.I "grep -c '#a' junk"
will determine the number of lines of text in junk which begin
with an "a".
.tr ##
(See the section entitled "Searching a File" - UnitI, ModuleIV)
.L1
The parent directory of "d" is
.I "B."
(See the section entitled "System directories - UnitII, ModuleI)
.L1
.I "/u3/A/B/D/D2"
will be displayed if %pwd is issued.
(See the section entitled "Pathnames" in UnitII, ModuleI)
.L1
.I "cd D/D2"
will transfer you from "B" to "D2".
(See the section entitled "Changing Directories" - UnitII, ModuleII)
.L1
.I "mv /u3/A/C/F/junk junk"
will copy and delete the file junk from directory "F".
(See the section entitled "The Move Command" - UnitII, ModuleII)
.L1
.I "opr /u3/A/C/F/temp "
will obtain a paper listing of the file temp located in directory "F".
(See the section entitled "Using your neighbor's files" - UnitII, ModuleII
and the section entitled "The Opr Command as a Filter" - UnitI, Module III)
.L1
.I "ls -l /u3/A"
will list the files in the login directory.
(See the section entitled "Pathnaames" - UnitII, ModuleII)
.L1
.I "mkdir /u3/A/C/F/F1"
or
.I "cd F; mkdir F1"
will make a subdirectory  "F1" in directory "F".
(See the sections entitled "Pathnames," Creating Directories" and Transferring
Files in UnitII, ModuleII)
.L1
.I "rmdir D/D1"
or
.I "cd D; rmdir D1"
will delete the directory D1.
(See the sections entitled "Transferring Files" and "Removing Directories"
in UnitII, ModuleII)
.L1
.I "g/unix/s//UNIX/gp"
will change all occurrences of unix to UNIX and display the corrected lines.
(See the section entitled "The Global Command" - UnitIII, ModuleI)
.L1
.I "/software/
.br
.I "//"
.br
.I "s/software//"
.sp
will delete the 2nd occurrence of software.
(See the sections entitled "The Substitute Command" and "Other Examples"
in UnitIII, ModuleI)
.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."
(See the section entitled "The Substitute Command" - UnitIII, ModuleI)
.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.
(See the section entitled "The Append Command" - UnitIII, ModuleI)
.L1
.I
0a
.br
The Unix family has greatly increased the flexibility of the
operating system.
.br
\&.
.R
.sp
will place the above sentence at the beginning of the file.
(See the section entitled "The Append Command" under "Advanced Features"
in UnitIII, ModuleI)
.L1
.I "6,10w part"
will create a file called part consisting of lines 6 - 10 of success.
(See the section entitled "The Edit Command" under "Advanced Features"
in UnitIII, ModuleI)
.L1
.I "$-2,$d"
will delete the last 3 lines of success.
.ne 10
(See the section entitled "The Delete Command" and "The Dollar Sign"
in UnitIII,ModuleI)
.L1
.I
w part
.br
e success
.br
1,$ s/$/$/
.R
.sp
will place a "$" at the end of each line.
(See the sections entitled "The Edit Command," "The Substitute Command"
and "The Dollar Sign" in UnitIII, ModuleI)
.L1
.I "0r part"
will prepend the file "part" to success.
(See the section entitled "Line numbers with read" - UnitIII,ModuleI)
.L1
.I "nroff -o10-40 missile|opr"
will obtain a paper listing of pages 10 - 40 of the file, missile.
(See the section entitled "Introduction to Nroff" - UnitIII,ModuleII
and the section entitled "The Opr Command as a Filter" - UnitI, ModuleIII)
.L1
.I "\&.ds CS DELETE NEXT LINE"
and
.I "\e*(CS"
will define and execute the character string, CS.
(See the section entitled "Defining character strings" - UnitIII,ModuleII)
.L1
.I
\&.de FM
.br
\&.af % i
.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
.ne 18
(See the section entitled "Define Command" - UnitIII,ModuleII)
.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
(See the sections entitled "Outline Style Paragraph Headings" and "Table
of Contents" in UnitIII, ModuleIII)
.L1
.I
\&.ta 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.
(See the section entitled "Defining Tabs" - UnitIII,ModuleII)
.L1
.I
\&.de re
.br
\&.tl ''RETENTION DATE: \e$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.
(See the section entitled "Arguements" - UnitIII,ModuleII)
.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.
(See the sections entitled "Footers" and "Classification" - UnitIII,ModuleIII)
.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.]
.ne 10
(See the section entitled "Paragraph Headings" - UnitIII,ModuleIII)
.L1
.L2
\&.ul 5--will underline the next five lines.
.L2
\&.E1  --signifies the end of level one text.
.L2
\&.PP  --will begin a paragraph and indent the first line by 8 spaces.
.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
.in +8
(For (A) see "Underlining Text" - UnitIII, ModuleII. For (B)
see "Forming Outlines" - UnitIII, ModuleIII. For (C) see
"Paragraph Formation" - UnitIII, ModuleIII. For (D) and (E)
see "Automatic Indenting" - UnitIII, ModuleII>)
.in -8
.L1
MP119 is an introductory course on
.I "Unix"
for the novice.
.br
will be displayed.
(See the section entitled "Underlining" - UnitIII,ModuleIII)
.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
(See the sections entitled "Paragraph Headings" and Forming Outlines"
in UnitIII, ModuleIII)
.L1
.I
1.  <text>
.br
2.  <text>
.br
3.  <text>
.R
(See the section entitled "Paragraph Headings" - UnitIII,ModuleIII)
.L1
.I "e +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.
(See the section entitled "Editor Command" - UnitIV)
.L1
.I
<break>
.br
50
.br
<scroll down>
.R
.sp
will display the 50th previous line or the begining of the file.
(See the section entitled "Scanning a File" - UnitIV)
.L1
Line 150 will be displayed as the current line.
(See the section entitled "More on Scanning" - UnitIV)
.L1
The alternate buffer holds the most recently deleted text.  It may be
referenced by:
.I "<break>, <PUT> <F4>"
(See the section entitled "Copying and Repositioning Text" - UnitIV)
.L1
The
.I  PICK and PUT <F3 and F4>
function keys are used to reposition text within a file.
(See the section entitled "Copying and Repositioning Text" - UnitIV)
.L1
.I
Delta~Data~~~~~~~~~~~~~~~Superbee
.br
<break>~~GO TO~~~~~~~~~~~<break>~~F7
.br
<break>~~text~~-SEARCH~~~<break>~~text~~F6
.R
.sp
would be typed to locate the word "text", which is located near the
end of the file.
(See the sections entitled "More on Scanning" and "Searching a File"
in UnitIV)
.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.
(See the section entitled "Removing Text" - UnitIV)
.L1
The MAKE PORT <ctrl z> function allows you to view more than one  file
simultaneouly.
(See the section entitled "Manipulating Files Simultaneously" - UnitIV)
.L1
.I
<break> 2
.br
ENTER
.R
.sp
would be used to make the 2nd file the current file.
(See the section entitled "Manipulating Files Simultaneously" - UnitIV)
.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
(Note: for the Superbee Step 5 is F4)
.sp
will copy 10 lines from the current file to file "temp".
(See the section entitled "Copying and Repositioning Text" - UnitIV)
.E1
.E2
