



                         INTRODUCTION TO UNIX










          uu         uu        nn       nn    iii     ttttttttt
          uu         uu        nnn      nn    iii        ttt
          uu         uu        nn n     nn    iii        ttt
          uu         uu        nn  n    nn    iii        ttt
          uu         uu        nn   n   nn    iii        ttt
          uu         uu        nn    n  nn    iii        ttt
          uuuuuuuuuuuuu        nn     nnn     iii        ttt


                            iiiiiiiiiiiiiiiiiiiii
                               iii  ii      ii
                               iii   ii    ii
                               iii    ii  ii
                               iii     iiii
                            iiiiiiiiiiiiiiiiiiii

                              (The RAND Editor)




















                                                 Mildred M. Ware
                                                 September, 1978
                                                      P.G











   MP119                                        Introduction to UNIX


                        _T_A_B_L_E _O_F _C_O_N_T_E_N_T_S


                           _U_n_i_t _I_V



    A.  Objectives for Unit IV_________________________________ 1

    B.  Introduction to Unit IV_________________________________2

    C.  Rand Editor Function Keys______________________________ 3

    D.  The Editor Command_____________________________________ 4

    E.  Scanning A File________________________________________ 7

    F.  Modifying A File_______________________________________ 11

    G.  Inserting Text_________________________________________ 12

    H.  Removing Text__________________________________________ 16

    I.  Searching A File_______________________________________ 17

    J.  Copying and Repositioning Text_________________________ 20

    K.  Manipulating Files Simultaneously______________________ 25

    L.  Idiosyncrasies of the Rand Editor______________________ 30

    M.  Summary Of Commands____________________________________ 34

    N.  Unit IV Proficiency Test_______________________________ 35



















                                 - i -






   MP119                                        Introduction to UNIX


                  _U_n_i_t _I_V---_R_A_N_D _E_d_i_t_o_r


        This unit discusses the Rand Editor, an alternate method  of
   editing  files.  Topics will include inserting, deleting, reposi-
   tioning, changing, and searching text  in  files.   Creation  and
   manipulation of several files will also be discussed.

        _O_b_j_e_c_t_i_v_e_s _f_o_r _U_n_i_t _I_V

   When you complete this unit, you will be able to:



    1.  Use the command to gain access to the Rand Editor.

    2.  Create a file using the Rand Editor.

    3.  Exit the Rand Editor.

    4.  Append text into an existing file.

    5.  Reposition text within an existing file.

    6.  Modify text within a file.

    7.  Delete text from an existing file.

    8.  Move lines of text from one file to another file.

    9.  Search for specific groups of characters.

   10.  Edit several files simultaneously.



















                                 - 1 -
   Unit IV                                               Rand Editor






   MP119                                        Introduction to UNIX


        _I_N_T_R_O_D_U_C_T_I_O_N


        After examinining  the  objectives  above,  you've  probably
   formed  the conclusion that there is no need to study this module
   since you already know how to perform all of the objectives.

        Well, you could not be more wrong.  Even  though,  the  Text
   Editor and the Rand Editor are similar in the tasks they perform,
   the ways in which these tasks are performed are  completely  dif-
   ferent.

        In contrast to the Text Editor, the Rand Editor  is  a  page
   editor  which  allows  the  many manipulations to be performed by
   depressing a single key.  You no  longer  need  to  be  concerned
   about the current line, line numbers, or editing commands.

        This by no means indicates the the  Text  Editor  should  be
   discarded.  There are certain functions which can be performed in
   the Text Editor that aren't available in the Rand Editor, such as
   modifying a particular character throughout the file.

        The editor you select to use will largely depend  upon  your
   application.  While  most  people prefer the RAND Editor for most
   applications, the UNIX Editor will occasionally prove more  suit-
   able for the task at hand.

        At the very beginning of this course, it  was  explained  to
   you  that  there are certain differences in the terminals.  Up to
   this point the differences have been minimal.  Now  for  the  bad
   news:   the Superbee and Delta Data 7000 terminals have different
   names for ten of the Rand Editor functions.  Since the Delta Data
   7000  uses  mnemonic names for its keys, its users should have no
   problems.  This is not to suggest that the Superbee users will be
   deluged  with  problems, rather that they will have to make a few
   concessions to those dark brown keys on the  upper  left  of  the
   keyboard, and remember just which "F" key does what.  In order to
   facilitate this, whenever the Delta Data and Superbee keys for  a
   given  function  differ,  the Superbee key will be in parentheses
   (or in these '<>' braces) following the mnemonic Delta Data  key.
   Delta   Data   users   are  requested  to  ignore  references  to
   unrecoqnized keys.

        Most Superbees will have a list of the RAND Editor functions
   and appropriate keys posted somewhere in the vicinity of the ter-
   minal.  If your terminal does not have one contact operations.





                                 - 2 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        Please take a look at the schematics on the next two  pages,
   and familiarize yourself with the Rand Editor keys.
   The following keys are used to perform the various editor functions  on the DELTA DATA 7000

               -----------------------------------------------------------------------------
              |enter |scroll|  next | save |      |      |      | use  |     |      | done  |
              |      |  up  |  page | file |      |      |      |      |clear|      | rubout|
              ------------------------------------------------------------------------------
              |      |scroll|  prev |      |      |      |      |  exec|     |      |       |
              |      |down  |  page |      |      |      |      |      |     |      |       |
              ------------------------------------------------------------------------------



                                         ________________________              _____________
                                         |ins   |       |  del  |              |           |
                                         |line  |       |  line |              | => port   |
                                         ------------------------              -------------
                                         |      |       |       |              | <= port   |
                                         |      |       |       |              |           |
                                         ------------------------              |-----------|
                                         | new  |       |       |              |  make     |
                                         | line |       |       |              |  port     |
                                         ------------------------              |-----------|
                                         |      |up     |       |              | + search  |
                                         |      |arrow  |       |              |           |
                                         ------------------------              |-----------|
                                         |left  |       |right  |              | - search  |
                                         |arrow | HOME  |arrow  |              |           |
                                         ------------------------              |-----------|
                                         |      |down   |       |              |   pick    |
                                         |      |arrow  |       |              |           |
                                         -----------------------               |-----------|
                                         | delete       |       |              |   put     |
                                         |  character   |       |              |           |
                                         ------------------------               ------------
















                                 - 3 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


        These keys are used to perform various Rand Editor functions
   on  the  SUPERBEE.   Please  note  that the equivalent Delta Data
   notation for the "F" keys is noted above them in parentheses.


   (PORT<=) (PORT=>)  (PICK)  (PUT)  (+SEARCH) (-SEARCH) (GO TO)
   ---------------------------------------------------------------
   |  F1   |   F2   |  F3   |  F4   |   F5    |   F6    |   F7   |
   ---------------------------------------------------------------

          --------------------------------------------------------
          |enter|    |next |prev|scroll|scroll |     |     |clear|
          |     |    |page |page|down  |up     |     |     |     |
          --------------------------------------------------------


                                 -------------------
                                 |INS |      |DEL  |
                                 |CHAR|      |CHAR |
                                 -------------------
                                 |INS |UP    |DEL  |
                                 |LINE|ARROW |LINE |
                                 -------------------
                                 | =>  |    |  <=  |
                                 |ARROW|HOME| ARROW|
                                 -------------------
                                      | DOWN  |
                                      | ARROW |
                                      ---------


   _A_t_t_e_n_t_i_o_n _S_u_p_e_r_b_e_e _U_s_e_r_s: there are a few  other  keys  that  you
   will  be using The EXEC, USE, MAKE PORT, and SAVE FILE keys found
   on the Delta Data  correspond  to  "control  characters"  on  the
   Superbee.   Look on the bottom left of the keyboard, and you will
   see the "ctrl" key.   The "ctrl" key will perform a certain func-
   tion  when used simultaneously with a letter key.  Note that: USE
   = <ctrl B>, EXEC = <ctrl X>, MAKE PORT = <ctrl Z>, and SAVE  FILE
   = <ctrl V>.


        _E_d_i_t_o_r _C_o_m_m_a_n_d


        Let's digress a moment  to  demonstrate  how  one  can  gain
   access  to the Rand Editor, before we discuss the different func-
   tions.  The command used to access the editor is:

                  e [+] [name] [n] [nm]


                                 - 4 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        Where "e" is short for the editor and "name" is the name  of
   the file to be edited.

   Example:

                            e   junk

   will cause the first 23 lines of the file "junk" to be  displayed
   in a "window" 78 columns wide as shown below:

              _____________________________________________________
              | Now is the time                                    |
              | For all good men                                   |
              | to come to the                                     |
              | aid of their party                                 |
              |                                                    |
              |-                                                   |
              |                                                    |
              |                                                    |
              |____________________________________________________|
                                                      junk line 6
   Beneath the "window," the system will display  the  filename  and
   the current line number (line on which the cursor is positioned).

        If "n" is specified following the name, such as:

                            e junk 50

   the editor will be invoked and the  file  will  be  automatically
   advanced  to the 50th line. Therefore, line 50 will appear at the
   top of the window.  This option  allows  you  to  scan  the  file
   beginning at line 50.

        Let's take a look at the next option and see  what  happens.
   For instance, suppose you entered the following command:

                            e junk 50 10

   This causes the 10th character of each line to be displayed along
   the  left  margin. That is, the 10th character will appear as the
   first character of each line.  Line 50  will also be displayed at
   the top of the window.

        This  feature  can  be   quite   benificial   in   comparing
   corresponding  characters  or  in  trying  to detect a particular
   sequence.

        The last option, the "plus," is also  of  significance.   If
   the  filename  is preceded by the "+," the previously edited file
   is established as an alternate file, thereby giving you access to
   two  files.  To reference the alternate file, you would press the

                                 - 5 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   "USE" or <ctrl B> key.  Here is how that would be done.

                            e junk

                            {edit junk

                            and leave the editor}

                            e +temp

   This would establish "temp" as the current file and "junk" as the
   alternate  file.   You  can  change from one file to the other by
   pressing the "USE" or <ctrl B> key.

   Notes:(1) If the editor is called without specifying a  filename,
             the editor will use the most recently edited file.
         (2) If the editor is called  and  there  is  no  previously
             edited file, follow these steps:
                  a.  Depress the "BREAK" key.
                  b.  Type an unused filename.
                  c.  Press "USE" or <ctrl B>.


   Note: This same procedure can be used to reference  an  alternate
         file  anytime  after  the editor has been invoked, allowing
         you to specify the alternate file.

        If the filename specified is a non-existent file, type "USE"
   or  <ctrl  B>  as soon as you have access to the editor.  This is
   the manner in which files are created using the editor.

        You are now ready to begin manipulating  your  file.   First
   let's  take  a  look  at the various ways a file may be viewed or
   scanned.


















                                 - 6 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


        _S_c_a_n_n_i_n_g _a _F_i_l_e


        The Rand Editor provides functions that allow a file  to  be
   scanned from any direction: up, down, left or right.

        Remember those two keys, SCROLL UP and  SCROLL  DOWN?  Well,
   they are also used in the editor to move the window up or down 10
   lines.

        The number of lines to scroll up or down can  be  controlled
   by  using  the "BREAK" key in conjunction with the "SCROLL" keys.
   Before continuing with an example, let's lay a little foundation.

        First, all of the editor  keys  are  functions.   This  just
   means  that  all  the  keys  have  been  programmed  to perform a
   specific action: e.g., the "SCROLL" keys are programmed  to  move
   the "window" up and down.

        These functions are no different from  any  other  function.
   That  is,  values called arguments may be passed to them and used
   by them to replace the established default values which will nor-
   mally  be  used.    Ten  lines is the established default for the
   "SCROLL" keys.

        The "BREAK" key  allows  you  to  enter  an  argument  which
   replaces the default.  In some instances a number is required and
   in other instances, characters are required  depending  upon  the
   function.

        Now let's get back to moving the "window" _n lines, where "n"
   is  some number other than 10. You will first depress the "BREAK"
   key, then type  the  desired  number,  and  depress  one  of  the
   "scroll"  keys.  For  instance, to advance the "window" 15 lines,
   type:

                       <break key>
                            15
                       <scroll up key>

   Notes:(1) When the "BREAK" key is depressed the  editor  displays
             "ARG"  below  the  "window."   What  you type next will
             appear adjacent to it.
         (2) If the "BREAK" and "SCROLL UP" keys  are  used  without
             entering  an argument, the text is moved up so that the
             line with the cursor is the first line of the "window."
         (3) If the "BREAK" and "SCROLL DOWN" keys are used  without
             entering  an  argument,  the text is moved down and the
             line with the cursor is the last line of the "window."


                                 - 7 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


        As mentioned earlier, the file may be moved  either  to  the
   left  or  to  the right.  This is achieved by using the "PORT =>"
   <F2> and the "PORT <=" <F1> function keys.   The  "PORT  =>"  key
   <F2>  moves the text in the "window" left 16 columns each time it
   is depressed.  The "PORT <=" key moves the text in  the  "window"
   right  16  columns  each time it is depressed.  Suppose your file
   appears as:
               ------------------------------------------|
              |Now is the time now is the time           |
              |For all good men,all good men             |
              |To come to the aid, the aid               |
              |Of their country, their country           |
               -------------------------------------------

   If you press "PORT =>" <F2>, the file will be displayed as:

                ------------------------------------------
               <now is the time                          |
               <, all good men                           |
               <id, the aid                              |
               <, their country                          |
               -------------------------------------------


        The "<" indicates there is more text  to  the  left  of  the
   line.  What would you do to restore the "window" back to its ori-
   ginal state?  Answer in the space provided:




        If your answer is  depress the "PORT <="  key  <F1>,  that's
   correct.  Since "PORT =>" <F2> moved the "window" left, and "PORT
   <=" <F1> does exactly the opposite of "PORT =>" <F2>,then it log-
   ically  follows that the "PORT <=" key <F1> would be used to move
   the "window" back towards the right.

   Note: The number of columns the "window" is moved either  to  the
         right  or  to  the  left  can  be controlled also by taking
         advantage of the "BREAK"  key.    Suppose  you  wanted  the
         "window"  shifted 5 positions to the  right, then you would
         depress:

                        <break>
                           5
                        PORT <= <F1>





                                 - 8 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        _P_a_g_i_n_g


        An entire "window" of text, referred to as a  page,  may  be
   moved  either  up  or  down  by depressing the "NEXT PAGE" or the
   "PREVIOUS PAGE" key, respectively.

        Each time the "NEXT PAGE" key  is  depressed,  the  next  23
   lines  of text are moved up into the window.  Likewise, each time
   the "PREVIOUS PAGE" is depressed, the previous 23 lines  of  text
   are moved down into the window.

        These features give you the capability to scan a file either
   forward or backward.

        You are probably thinking how tedious this would be  if  the
   pages  you  want    to  view are located in the middle of a large
   file.  As always, Unix provides features to make the life of  the
   user  a  little  easier.  A file may be advanced or backed up any
   number of pages by using the "BREAK" key and entering an argument
   before depressing one of the above mentioned keys.


        _M_o_r_e _o_n _S_c_a_n_n_i_n_g


        A function is also provided  which  allows  you  to  specify
   which  line  you  want  to view.  This line and surrounding lines
   will be moved to the window. This feature is extremely beneficial
   in modifying a file, especially if the corrections to be made are
   scattered throughout the file. You gain access to  this  function
   via the "GO TO" key <F7>, as follows:

                          <break>
                          50
                          <GO TO> <F7>


        The sequence shown above will cause the  editor  to  display
   line  50  with the cursor in the first position of the line. This
   feature can also be used to scan a file either forward  or  back-
   ward. The line specified doesn't have to be a subsequent line.










                                 - 9 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


        Hang on, the best is yet to come.   Suppose  you  have  just
   entered  the  editor,  and  you want to reference a line near the
   end of the file.  Which approach would you take?   Well,  any  of
   the  previously  discussed  methods  can  be used, but would pose
   quite a task. However, this may  be  achieved  with  very  little
   effort.  Just type:

                          <break>
                          <GO TO> <F7>

   and the cursor will be positioned just past the last line of text
   in the file.

   Note: The "GO TO" Key <F7> used  without  the  "BREAK"  key  will
         position the cursor at the beginning of the file.


        _L_e_a_v_i_n_g _t_h_e _E_d_i_t_o_r


        After you have finished editing or creating your  file,  you
   must  then depress the "RUBOUT" key.  This takes control from the
   editor and returns it to the command level.

        Not only does the "RUBOUT" key take you out of  the  editor,
   but  it  places a copy of the modified file in your directory. In
   addition, a copy of the unmodified file remains  in  your  direc-
   tory.   This  is referred to as a backup file and is assigned the
   name "filename.bak".

        Unlike most systems, when the system crashes while a file is
   being  edited, the entire file isn't destroyed, only the modified
   version.  Or, if you aren't satisfied with  the  results  of  the
   modified  file, you can begin again by deleting the modified file
   and editing the backup file.  The new backup file would  then  be
   "filename.bak.bak."

        In the event of a system crash the modified file can in most
   cases be salvaged, by issuing the following sequence of commands:

                %cp /tmp/rettyx.login-name retty
                %editor -retty

   where "x" in the above commands refers to  your  terminal  number
   and,  "login-name"  is your login name. Here is an example of how
   the first line appears.

                     %cp /tmp/rettyn.mmw retty
                     %editor -retty


                                - 10 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   This causes the Editor to rerun your  editing  session;  it  will
   leave  you at the point where the system crashed.  I suggest that
   the next thing to do is to save your file.

   Notes:(1) Backup files are manipulated the same as regular  files
             in all aspects
         (2) DO NOT use the Rand Editor before you have  issued  the
             above sequence of commands.


   Let's check how you're doing.  Work the following exercise.


        _E_x_e_r_c_i_s_e

   Using one of your existing files:

    1.  Gain access to the Rand Editor

    2.  Scan the file using the methods discussed.

    3.  Repeat beginning with #1, except use the backup file.

        _M_o_d_i_f_y_i_n_g _a _f_i_l_e


        Notice the keys on the right of  the  keyboard.   These  are
   used to position the cursor, to insert text, and to delete text.

        The manner in which characters are entered or changed in the
   Rand Editor differs tremendously from the Text Editor, and should
   prove to be quite an enjoyable experience.  There are no restric-
   tions  on  where  the  current input position is on the page. The
   cursor may be moved up, down, right, or left. And,  wherever  the
   cursor is placed, that becomes the current input position.

        Characters or lines of characters may be modified by  simply
   moving the cursor and retyping.

        There are 5 keys used for moving the cursor, the "HOME"  key
   and  the  "ARROWED"  keys.   The  "HOME" key positions the cursor
   under the first character on the page; and the "ARROWED" keys are
   used to move the cursor in the direction indicated on the key.

   Note: The "TAB" key is used to move the cursor 8 spaces at a time
         from  left  to  right.  The "BACK TAB" key will do just the
         opposite.





                                - 11 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        _I_n_s_e_r_t_i_n_g _T_e_x_t


        Characters and blank lines may be inserted into the text  by
   using the "INS CHAR" and the "INS LINE" keys.

        The "INS CHAR" key, when depressed, places the  terminal  in
   the insert mode.  You will see a message to this effect displayed
   below the "window."  While the terminal is in  the  insert  mode,
   everything you type will be inserted just before the cursor.

        You needn't concern yourself about "over writing" any  char-
   acters.  The system will make room for the inserted characters by
   shoving the characters following the cursor over to the right.

        Once you have entered the intended characters,  depress  the
   "INS  CHAR" key again.  This takes the terminal out of the insert
   mode.

        Single characters, words, phrases, or complete sentences may
   be inserted.

        Example:  Suppose you inadvertently typed:

                  The Rand Editor is a tool to use.

        instead of:

        The Rand Editor is an extremely powerful tool to use.

        And let's further assume that this sentence is embedded in a
   paragraph.   To  correct without using the insert mode, you would
   have to retype that line and  the  remainder  of  the  paragraph.
   Let's see how the insert mode can be used to facilitate this.

        Step 1: Position the cursor to the spot on  the  line  where
                the characters are to be inserted:

                The Rand Editor is an tool to use.
                                      -

        Step 2: Depress the "Ins Char" key.

        Step 3: Now type the following:

                    extremely powerful

        Step 4: Depress the "Ins Char" key.

        The line will now appear as:


                                - 12 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

             The Rand Editor is an extremely powerful tool to use.

        Lines of text or blank lines can also be inserted  within  a
   file  by  using  the "INS LINE" key.  Upon depression of the "INS
   LINE" key, the editor will insert a blank line  just  before  the
   line  on  which the cursor is positioned.  You can then leave the
   line blank or type some data on it.

        Several blank lines may be inserted  by  successive  depres-
   sions of the "INS LINE" key, or by striking:

                       <break key>
                       <enter some number>
                       <ins line key>


        _O_t_h_e_r _O_p_t_i_o_n_s


        The Rand Editor  is   extremely  flexible.  It  even  allows
   blanks  or  spaces to be inserted within a certain area of a line
   or within a certain area of several lines.  This is  achieved  by
   using the "BREAK" key, the "INS LINE" key, and moving the cursor.
   How this is done can probably be best explained  by  an  example.
   Assume that you have the following typed in a file:

                  Procedure for running a program

        Step 1: Depress the start button on the console.
        Step 2: Depress the power button on the card reader.
        Step 3: Turn on the paper button on the printer.
        Step 4: Pull the master switch on the printer.


        You then decide that you want 10 spaces  inserted  following
   the colon. Here's what you would do:

   (Let's insert spaces in line 1 first)

    1.  Position the cursor

          Step 1:  Depress the start button on the console.
                   -

    2.  Depress the "BREAK" key.

    3.  Move the cursor 10 positions as follows:

          Step 1:  Depress the start button on the console
                   -------------


                                - 13 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

       Note: The Editor will display  "cursor defined" as the  argu-
             ment for the "BREAK" key.

    4.  Depress the "INS LINE" Key.

       Line 1 of your file will now appear as:

       Step 1: Depress the start button on the console.

        Do the following to insert 10  spaces  following  the  colon
   throughout the procedure:

    1.  Follow steps 1 through 3 of the above example.

    2.  Move the cursor downward to the last line to be modified.

             Step 1:  Depress the start button on the console.
                      -----------
             Step 2:  Depress the power button on card reader.
                                -
             Step 3:  Turn on the paper button on the printer.
                                -
             Step 4:  Pull the master switch on the printer.
                                -

    3.  Depress the "INS LINE" key.


   Note: The "INS LINE" key can also be used to move characters from
         one line to the next. Here is how that is done:

         Given:  Step 4: Pull the master switch on the printer.

         If the following steps are performed:

               a.  Position the cursor under the "P" of pull.

               b.  Depress the "BREAK" key

               c.  Depress the "INS LINE" key.

         the results will be:

               Step 4:
               Pull the master switch on the printer.







                                - 14 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   It's time for another check of your progress.  Do  the  following
   exercises.

        _E_x_e_r_c_i_s_e_s

   Use the Rand Editor to do the following:

    1.  Create the following file:

             Procedure for running a program
             Step 1: Depress the button on the console.
             Step 2: Depress the power button on card reader.
             Step 4: Pull the master switch on the printer.

    2.  Using the file in #1 insert  3  blank  lines  following  the
        title.

    3.  In line 2, insert the word "start" just before button.

    4.  Insert the following line just before "Step 4."
             Step 3: Turn on the paper button on the printer.

    5.  Modify the 2nd line such that it appears as:
             Step 1: Depress the start button on the console.


   If you had any problems,  reread  the  "Other  Options"  section.
   Otherwise, let's move on.
























                                - 15 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


        _R_e_m_o_v_i_n_g _T_e_x_t


        Now that you've learned how to insert  text,  let's  discuss
   how  to delete text.  UNIX further demonstrates its uniqueness in
   the manner in which it allows you to remove  text  from  a  file.
   Single characters, portions of a line/lines, or entire line/lines
   of text may be removed from a file by back spacing with the  cur-
   sor  and  over-striking with the shift or by using the "DEL CHAR"
   or "DEL LINE" keys.  or the "DEL LINE" key.

        The "DEL CHAR" key deletes the  character  under  which  the
   cursor is positioned when depressed.

        Characters can also be deleted  by  the  "BACKSPACE  DELETE"
   <cntrl  carrot()>.  Backspace  delete  is  similar  to  the space
   bar(shift) except that it moves the cursor to the left instead of
   to  the right. In normal mode, it moves the cursor left one posi-
   tion, and inserts a blank in that position. In  insert  mode,  it
   moves  the  cursor  left  one position, deleting the character at
   that position and moving all characters  to  ther  right  of  the
   deleted character one position to the left.

        To delete portions of a line or entire lines, the "DEL LINE"
   key is used.  Each time the "DEL LINE" key is depressed, the Edi-
   tor deletes the line containing the cursor.

        To obviate the need to repeatedly press the "DEL  LINE"  key
   to delete several lines, the "BREAK" key may be used.

        Portions of a line may be deleted by adhering to the follow-
   ing procedure:

        Step 1: Position the cursor under the first character in the
                string of characters to be deleted.

        Step 2: Depress the "BREAK" key.

        Step 3: Move the cursor just past the last character of  the
                string to be deleted.

        Step 4: Depress the "DEL LINE" key.

   Sounds familiar doesn't it?  You will notice that the same  basic
   steps were used to insert spaces within a line.

        Now, let's determine how an area (the same number of charac-
   ters on several different lines) can be deleted.

        Step 1: Follow steps 1 thru 3 of  the  preceding  procedure.

                                - 16 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

                The  directions  refer  to  line 1 of the area to be
                deleted.

        Step 2: Move the cursor  downward,  remaining  in  the  same
                column, until you reach the last line in the area to
                be deleted.

        Step 3: Depress the "DEL LINE" key.

   Notes:(1) To delete all characters from the cursor to the end  of
             a  line,  depress  the "BREAK" key followed by the "DEL
             LINE" key. This also has the effect  of  attaching  the
             next line to the current one.

         (2) Blanks are characters.  Therefore, they may be  deleted
             also.

                   (3) You  can  insert  multiple  blank  spaces  on
             several  lines  (i.e. white space) by using a procedure
             which closely resembles the above  described  procedure
             for  deleting  the same number of characters on several
             different lines. The only difference is that instead of
             hitting "DEL LINE" at the end hit "INS LINE".

                   (4) When you delete a line using the  "DEL  LINE"
             key  or  several  lines  using  the procedure described
             above the material that is deleted  is  stored  in  the
             CLOSE  or  ALTERNATE  buffer. The most recently deleted
             material (i.e. the last  close  buffer  entry)  can  be
             recovered  by  typing <break> PUT (or <break> F4 on the
             Superbee).  This procedure will prove very useful  when
             you accidently delete a line.

        _E_x_e_r_c_i_s_e


        Use one of your "play" files to practice the procedures dis-
   cussed  in this section.  (This should be easy, as the procedures
   are so similar to those involved in inserting text.)

        _S_e_a_r_c_h_i_n_g _a _F_i_l_e


        This next feature is extremely useful in making  corrections
   to  a  file,  such  as  correcting  spelling  errors or modifying
   phrases.  It saves you from  the  boring,  tedious  operation  of
   scanning the file, and using one of the methods discussed earlier
   to locate the item to be modified.




                                - 17 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        You can actually specify a word or  a  group  of  words  and
   direct  the editor to locate them for you.  The functions used to
   achieve this can be accessed through the "+SEARCH" <F5>  and  the
   "-SEARCH"  <F6>  function  keys.  The characters searched for are
   called a "search" key.

        The "+SEARCH" <F5> function performs a forward search of the
   "search"  key  beginning  from  the cursor and continuing forward
   through the file until the first occurrence of the  "search"  key
   or the end of the file is encountered.

        The "-SEARCH" <F6> function performs a  backward  search  of
   the  search key beginning from the cursor and continuing backward
   through the file until the first occurrence of the  "search"  key
   or the beginning of the file is encountered.

        Suppose the cursor is positioned at  the  beginning  of  the
   file,  and you want to locate the word "procedure."  You would do
   the following:

                     Depress:  <break key>

                     Type:     procedure

                     Press:    +SEARCH <F5>

   Note: The editor will  display   "+Search:  procedure."  After  a
         short  pause,  the  editor  will  either point out the word
         "procedure" or it will display the message "search key  not
         found."   If  the latter happens, check the "search" key to
         ascertain that it was correctly entered.  If so,  then  the
         search key does not exist in the file.

        Okay, suppose the search is successful, that is, the  editor
   locates  the "search" key.  However, it isn't the one you wanted.
   You wanted the next occurrence of the "search" key.  What do  you
   do?   Well, you simply depress the  +SEARCH <F5> key again.  This
   causes the editor to begin another search for the  same  "search"
   key  beginning  from its present position.  Consequently, you can
   locate any occurrence of a "search" key by repeatedly  depressing
   the "+SEARCH" key <5> until you locate the one you want.

        Now, suppose that you aren't at the beginning  of  the  file
   and  you  initiate  a  forward  search.  The editor responds with
   "search key not found."  Yet, you are certain that the search key
   does  exist  in the file.  Well, before you decide "this thing is
   crazy!", consider this alternative -- that the  cursor  is  posi-
   tioned  past  the  search key that you are trying to locate.  How
   would you locate the search key in question?  Answer in the space
   provided.


                                - 18 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   That's exactly correct, you would initiate a backward  search  by
   using the "-SEARCH" <F6> key.

        _I_m_p_l_i_e_d _K_e_y_s


        Implied search keys are formed by using the "BREAK" key fol-
   lowed  by  either  the  "+SEARCH" <F5> or the "-SEARCH" <F6> key.
   You are probably wondering how this is different.  The difference
   is,  you  do  not enter an argument to be used as the search key.
   The argument is formed by using the  character  under  which  the
   cursor  is  positioned  as the first character of the search key,
   and the character just before the next space as the last  charac-
   ter of the search key.

        Just how can this feature be applied?  It can be used  as  a
   shorthand method of entering a search key.  How?  Well, you could
   be just scanning the file when you notice a  certain  word.   You
   become  curious as to whether or not it appears somewhere else in
   the file.  To determine whether it does,  you merely position the
   cursor  under  the  first  letter  of  the  word, and depress the
   "BREAK" and "+SEARCH" <F5> keys.






























                                - 19 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   Let's check ourselves one more time.  Do the following exercises.

        _E_x_e_r_c_i_s_e_s

   Use the following file for the exercises below:

             Now is the time, Now is the time
             For all good men, All good men
             to come to the aid, the aid
             of their country, their country.

   Use the Editor to:

    1.  Locate all occurrences of the word, aid.

    2.  Locate all occurrences of the word, now.

    3.  Locate the second occurrence of the word, time.

    4.  Locate the phrase, their country.

    5.  Locate all occurrences of the word, patriotic.


   I'm sure you had no problems.  Let's move on.

        _C_o_p_y_i_n_g _a_n_d _R_e_p_o_s_i_t_i_o_n_i_n_g _T_e_x_t


        You are really in for a treat.  The next  two  functions  of
   discussion,  "pick"  and  "put,"  offer tremendous flexibility in
   file modification.  While quite similar to the  move  command  in
   the Text Editor, they are a great deal more powerful.

        The pick function is used to pick up or  to  copy  lines  of
   text  and  place them into the "put" buffer.  There are currently
   two put buffers:  the main, which holds the text last picked  up,
   and  the  alternate, which holds the text last deleted.  Each can
   be put back into the file by using appropriate forms of the "put"
   function.

        This feature not only allows you to copy  or  to  move  text
   from one place to another, but also gives you access to text that
   has been deleted.

        The "PICK" <F3> and the "PUT" <F4> keys give you  access  to
   the "pick" and "put" functions.  Now for an example.  Suppose you
   have the following file.

                       Now is the time
                       For all good men

                                - 20 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

                       to come to the
                       aid of their country

        Now, suppose you want to modify this  file,  such  that  the
   first line also appears as the last line.  This is what you would
   do.

        Step 1:  Position the cursor on line 1.
        Step 2:  Depress the "PICK" key <F3>.
        Step 3:  Move the cursor to the line
                 following the last line.
        Step 4:  Depress the "PUT" key <F4>.

        The file now appears as:

                       Now is the time
                       For all good men
                       to come to the
                       Aid of their country
                       Now is the time

   Note: That line of text remains in the "put" buffer  until  some-
         thing else is picked up.  It may be placed in any number of
         places within the file by moving the cursor and  depressing
         the  "PUT"  key  <F4>.  What if text is already there?  The
         Rand Editor designers took that possibility into considera-
         tion  and  designed  the  Rand Editor so that it will  make
         room for the text in the "put" buffer.  It inserts  a  line
         just  before  the line containing the cursor and places the
         text in the "put" buffer there.

        Several lines may be placed into the "put" buffer by  either
   entering  an  argument  or  by  moving the cursor to indicate the
   number of lines to pick up.  Here is an example.

             To move 10 lines of text, you would:

             Step 1: Position the cursor on the first
                     line of text to be moved.
             Step 2: Depress the "BREAK" key.
             Step 3: Type the number "10."
             Step 4: Depress the "PICK" key <F3>.
             Step 5: Repeat steps 2 and 3.
             Step 6: Depress the "DEL LINE" key.
             Step 7: Move the cursor to the place
                     within the file where the text
                     in the "put" buffer is to be
                     placed.
             Step 8: Depress the "PUT" key <F4>.

   Notes: 1. In this example the main and the alternate buffers will

                                - 21 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

             contain  the  same  data.  Why?  The text picked up was
             also deleted.  Notice that the text was moved, not just
             copied.  Of course, we would omit steps 5 and 6, if the
             text were to be copied instead of moved.
          2. To place the text in the alternate buffer back into the
             file,  depress  the "BREAK" key just before you hit the
             "PUT" key <F4>.



   To pick up several lines by moving the cursor, you would:

             Step 1: Position the cursor on the first line of text
                     to be picked up.
             Step 2: Depress the "BREAK" key.
             Step 3: Move the cursor down until it rests on the
                     last line to be picked up.
             Step 4: Depress the "PICK" key <F3>.

   Note: This procedure can be modified and used to pick up portions
         of  a  line.  Even areas within the text may be placed into
         the "put" buffer.

   To pick up a portion of a line, follow this procedure:

             Step 1: Position the cursor under the first character
                     to be picked up.
             Step 2: Depress the "BREAK" key.
             Step 3: Move the cursor to just past the last character
                     to be picked up.
             Step 4: Depress the "PICK" key <F4>.



        Since a portion of a line has been picked up, the  text  may
   be placed within a line.  Suppose you had the following file:

                       Now is the time!
                       For all good men
                       to come to the
                       Aid of their country
                       Now is the time

        Here are the steps you would take to pick up "is the  time!"
   from line 1 and place it in line 5 between "Now" and "is."

             Step 1: Position the cursor under the "i" in "is"
                     on line 1.
             Step 2: Depress the "BREAK" key.
             Step 3: Move the cursor to just past the "e" in
                     "time."

                                - 22 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

             Step 4: Depress the "PICK" key <F3>.
             Step 5: Position the cursor under the "i" in "is"
                     on line 5.
             Step 6: Depress the "PUT" key <F4>.

   Line 5 will now appear as:

             Now is the time!is the time

   Note: Notice that the text is placed just before the cursor.

        If an entire line had been picked up and steps 5 and 6  were
   performed,  where  would the editor have placed the text?  Answer
   in the space provided.


   Answer: The editor would have placed the text just before line 5,
   not  on  line  5.   When  an entire line is placed into the "put"
   buffer, the editor expects it to occupy an entire line some other
   place within the file.

        Suppose you pick up a portion of a line,  and  you  want  to
   place  it  on  a  line  by  itself.  Can it be done?  yes________
   no________.

   Answer: It certainly can.  The editor won't make room for  it  to
   appear  on a separate line, but you can by inserting a blank line
   before depressing the "PUT" key <F4>.  Entire areas of  text  may
   also  be  placed  into  the "put" buffer by defining the area and
   then depressing the "PICK" key <F3>.

        Do you recall how to define an area?  It is done by  follow-
   ing  a  procedure similar to that used in the section on removing
   text.  Follow these steps:

        Step 1: Position the cursor under the first character to
                be picked up in line 1 of the area.
        Step 2: Depress the "BREAK" key.
        Step 3: Move the cursor to just past the last character
                to be picked up in line 1.
        Step 4: Move the cursor downward, remaining in the same
                column until you reach the last line in the area
                to be picked up.
        Step 5: Depress the "PICK" key <F4>.

        These two functions do not restrict you to the  manipulation
   of  text  in only one file.  Text may be copied or moved from one
   file to another To determine what that encompasses, let's look at
   an example.



                                - 23 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        Suppose you are in the editor modifying the file "junk" when
   you  notice  a  paragraph  that  could  be  used in another file,
   "temp." Here's what you would do to copy the paragraph:

        Step 1: Place the paragraph into the "put" buffer.
        Step 2: Depress the "BREAK" key.
        Step 3: Type the word "temp."
        Step 4: Press "USE" or <ctrl B>.

                Note: This brings "temp" into the editor as
                the current file.

        Step 5: Locate the place in "temp" where the paragraph
                is to be inserted.
        Step 6: Depress the "PUT" key.
        Step 7: Press "USE" or <ctrl B>.

                Note: This is returns junk as the current file.
   Let's review what we've just covered by doing the following exer-
   cises.

        _E_x_e_r_c_i_s_e_s

   Use the following file, RET, to answer the questions below.

             It's time!  It's time!
             It's Rand Editor time.
             Have some fun
             While you get the job done.
             Modify a file or two.
             You will be amazed
             At how quickly you are thru.
             And what used to seem a task,
             You'll now regret that it doesn't
             Last, and last and last.


    1.  Move the first 4 lines and place them  at  the  end  of  the
        file.

    2.  Copy the next 3 lines beginning with  "modify,"  and  append
        them to the end of the file.

    3.  Put the first 4 lines back into the file via  the  alternate
        buffer.

    4.  Pick up the phrase, Rand Editor time,  and  place  it  as  a
        heading in the file.

    5.  Copy the above file into another file called RET2.


                                - 24 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

        _M_a_n_i_p_u_l_a_t_i_n_g _F_i_l_e_s _S_i_m_u_l_t_a_n_e_o_u_s_l_y


        This feature truly exhibits the uniqueness of the UNIX  Sys-
   tem.  You have seen how you can manipulate several files within a
   single  editing  session.   However,  only  one  file  could   be
   displayed  at  a  time.   How  would  you like to be able to view
   several files simultaneously, and with a minimum amount of effort
   be  able  to branch from one to another?  This option is yours by
   simply using  "MAKE PORT" or <ctrl Z>, "ENTER" or <ctrl  C>,  and
   "SAVE" or <ctrl V> (some Delta Datas also use <ctrl V> instead of
   SAVE.)

        First, let's discuss "MAKE PORT" or <ctrl Z>.   "MAKE  PORT"
   <ctrl Z> is used to segment or subdivide the "window" in order to
   display more than a single file.  As an example, you are  editing
   the  file  "junk"  when  you  decide  to compare it with the file
   "temp."  This is the sequence of steps to follow: To  divide  the
   "window"  horizontally,  position the cursor to reflect where the
   division is to take place.

     ---------------------------------------------------------
     |.so /usr/lib/tmac.nm                                   |
     |.de 44                                                 |
     |.ti 24                                                 |
     |UNCLASSIFIED                                           |
     |.br                                                    |
     |today is \\$1 the \\$2 of \\$3                         |
     |-                                                      |
     |.br                                                    |
     |..                                                     |
     |.44 tuesday 4th July                                   |
     |                                                       |
     ---------------------------------------------------------
                                        File junk Line 6
     then type:      <break>
                     temp
                     <MAKE PORT>   <ctrl Z>














                                - 25 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   The "window" will now appear as:
     ...........................................................
     ..so /usr/lib/tmac.nm                                     .
     ..de 44                                                   .
     ..ti 24                                                   .
     .UNCLASSIFIED                                             .
     ..br                                                      .
     .today is \\$1 the \\$2 of \\$3                           .
     -----------------------------------------------------------
     |.so /usr/lib/tmac.nm                                     |
     |-                                                        |
     |.ds H1                                                   |
     |.ds Hr 7/28/78                                           |
     |.ds HL E53 memo                                          |
     |.ds CL SECRET                                            |
     |.L1 "" 0 a                                               |
     |This is text for Level one                               |
     -----------------------------------------------------------
                                    File temp Line 1

        You may now manipulate the bottom of  the  "window"  in  the
   same  manner  as if it were an entire "window."  That is, you may
   use any of the keys or functions discussed prior to this.  Now to
   transfer  to  the  top  of  the "window" and the file "junk," you
   would press "ENTER" <ctrl C>.  The "window" now appears as:


       ------------------------------------------------------------
       |.so /usr/lib/tmac.nm                                      |
       |.de 44                                                    |
       |.ti 24                                                    |
       |-                                                         |
       |UNCLASSIFIED                                              |
       |.br                                                       |
       |today is the \\$1 the \\$2 of \\$3                        |
       ------------------------------------------------------------
       ..so /usr/lib/tmac.nm                                      .
       ..ds H1                                                    .
       ..ds Hr 7/28/78                                            .
       ..ds HL E53 MEMO                                           .
       ..ds CL SECRET                                             .
       ..L1 " " 0a                                                .
       .This is the text for Level One                            .
       ............................................................
                                          File Junk Line 3


        Now answer this question in the space provided.  What do you
   think will happen if you type "ENTER" or <ctrl C> again?



                                - 26 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   You are correct if you said you are transferred back to the  file
   at  the  bottom  of  the "window." Now, to have "junk" occupy the
   entire window again, type MAKE PORT or <ctrl Z>.

        "MAKE PORT" or <ctrl Z> is not only used to create the small
   windows used  to display the different files, but it is also used
   to erase the small windows when they are no longer needed.   Sim-
   ply  depress  the "BREAK" key, then enter "MAKE PORT" or <ctrl Z>
   and the most recently created window will no longer  exist.   The
   next  most  recently  created window can be erased by hitting the
   "BREAK" key and entering "MAKE PORT" or <ctrl Z> again.

        You may segment either the large "window"  or  any  subdivi-
   sions  of the large "window" horizontally or vertically.  Windows
   may be formed horizontally by placing the cursor  anywhere  along
   the left margin and typing "MAKE PORT" or <ctrl Z>.  This permits
   you to decide the size of the smaller windows.

   Note: The same file may occupy more than 1 window.  Consequently,
         different  parts of a file may be simultaneously scanned or
         modified.

        To form windows vertically, the cursor is placed  along  the
   top  or  bottom  line  of the "window".  The example below illus-
   trates this.

      ---------------------------------------------------------------
      |.so /usr/lib/tmac.nm                                         |
      |.de 44                                                       |
      |.ti 24                                                       |
      |UNCLASSIFIED                                                 |
      |.br                                                          |
      |today is \\$1 the \\$2 of \\$3                               |
      |.br                                                          |
      |..                                                           |
      |.44 tuesday 4th July                                         |
      ---------------------------------------------------------------
                                           File Junk Line 1

   To do: Position the cursor at some point along the top line and
   type the following:

                             <break>
                               temp
                         MAKE PORT <ctrl Z>

   The window will appear as:





                                - 27 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

      ............................_________________________________
      ..so /usr/lib/tmac.nm      .|.so /usr/lib/tmac.nm           |
      .                          .|-                              |
      ..de 44                    .|.ds H1                         |
      ..ti 24                    .|.ds Hr 7/28/78                 |
      .UNCLASSIFIED              .|.ds Hl E53 MEMO                |
      ..br                       .|.ds CL SECRET                  |
      .today is \\$1 the \\$2 of .|.L1 " " 0 a                    |
      ..br                       .|This is a test                 |
      ...                        .|.L2                            |
      ..44 tuesday 4th July      .|This is a test                 |
      ............................|_______________________________|
                                        File Temp Line 1

   Now let's further subdivide junk by typing:
                       <ENTER>
                       <position cursor on line 5>
                       <break>
                        Junk2
                       MAKE PORT <ctrl Z>

        This will produce:

        ...........................................................
        ..so /usr/lib/tmac.nm       ..so/usr/lib/tmac.nm          .
        ..de 44                     ..ds H1                       .
        ..ti 24                     ..ds Hr 7/28/78               .
        .UNCLASSIFIED               ..ds HL E53 MEMO              .
        ..br                        ..ds CL SECRET                .
        ----------------------------..L1 " " 0a                   .
        |.so /usr/lib/tmac.nm      |.This is a test               .
        |-                         |.                             .
        |.PH "NM MACROS"           |..L2                          .
        |NM macros are commands    |. This is a test              .
        |ease the burden of format |.                             .
        |they are easily formed.   |.                             .
        |Outlines can be generated |.                             .
        --------------------------- ...............................
                                             File Junk2 Line 1


        Each of these little windows could also  be  further  subdi-
   vided  either  horizontally  or  vertically.   You are allowed to
   create a maximum of 10 windows and it's perfectly  fine  to  have
   two  windows displaying the same file.  We've determined that you
   can transfer from one file to another file by typing ENTER  <ctrl
   C>.  However, this causes a transfer to the next previously esta-
   blished file.  eg.  Suppose you are  modifying  "Junk2"  and  you
   decide  to  make  a  change in "junk."  This means that you would
   have to type ENTER <ctrl C> twice.  The first time ENTER <ctrl C>
   is typed, "temp" would become the current file.  Therefore, ENTER

                                - 28 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   <ctrl C> must be retyped  in  order  for  "junk"  to  become  the
   current file.

        You can imagine how cumbersome this would be in manipulating
   several  windows.   Consequently, Unix has provided a better way.
   It assigns numbers  sequentially  to  the  windows  as  they  are
   created.   Therefore,  to  reference  "junk," when "junk2" is the
   current file, you would type:

                         <break>
                            1
                      ENTER <ctrl C>


        Okay, let's discuss SAVE <ctrl V>.   SAVE  <ctrl  V>  allows
   you  to  "save" a file without exiting the editor.  "Save a file"
   simply means that the current version of the file  is  placed  in
   your  directory.   This  can be of immense benefit, especially if
   extensive modifications are to be performed on a file.

        Just as most systems break down occasionally, so does  Unix.
   When  this  happens  and you are in the editor, you will not have
   time to save your files.  Therefore all the modifications to  the
   file/files  will  be  lost.   Now, this will be of no real conse-
   quence if  you had intermittently typed SAVE  <ctrl  V>,  thereby
   causing the file to be continually updated.  The current file may
   be saved by typing:

                       SAVE <ctrl V>

   or, if you are editing more than one file, you  would  issue  the
   following for each file being edited:

                       <break>
                       <filename>
                       SAVE <ctrl V>

   where "filename" is the name of one of the files being edited.

        This feature can also prove  to  be  quite  advantageous  in
   creating large files.

   Note: SAVE <ctrl V> causes the updated versions to be  placed  in
         your backup file.

        That isn't all, SAVE <ctrl V> can be used to rename  a  file
   by  entering the alternate filename as the argument.  This causes
   the current file to appear in your directory  under  both  names.
   After leaving the editor, you can then delete the old file.



                                - 29 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   Ready for another checkup?  O.K., let's have a go.

            _E_x_e_r_c_i_s_e

   Use 3 of your existing files to perform the following:

    1.  Invoke the editor using the first file.

    2.  Enter the second file in vertically.

    3.  Transfer to the first file entered, and enter the third file
        horizontally.

    4.  Transfer to the first file and scan a couple of pages.

    5.  Rename the second file "joy."

    6.  Remove the second and third files from the window.

    7.  Exit the editor and check your directory for the file "joy."
        Delete "joy."

        _A_d_d_i_t_i_o_n_a_l _I_n_f_o_r_m_a_t_i_o_n _o_n _t_h_e _R_A_N_D _E_d_i_t_o_r


        Several significent features of the  RAND  Editor  have  not
   been  discussed  in  this  section.  For a consideration of these
   features consult "The CRT Text  Editor  NED  -  Introduction  and
   Reference  Manual."  A  copy of this document should be available
   from your system administrator.

        _I_d_i_o_s_y_n_c_r_a_s_i_e_s _o_f _t_h_e _R_A_N_D _E_d_i_t_o_r _o_n _S_u_p_e_r _B_e_e_s:


        Due to certain differences between the Ann  Arbor  terminal,
   for  which the Rand editor was originally written, and the Super-
   bee terminal, peculiar behavior has been known to occur.  At time
   of this writing the Delta Data 7000 did not seem to have any par-
   ticular idiosyncrasies when used with the  Rand  Editor,  so  its
   users can ignore this section.


   1. During an editor session any of the following may happen:
             * Capital letters (A,B,C,or D) are echoed when using the
               cursor motion keys.
             * Cursor addresses (F011011) are echoed.
             * Other characters appear when manipulating text which
               you are sure are not in the file.
             * Dots fill the screen.
      To respond to one  of  the  above  problems  first  press  the
      <clear>    button.    If  this  doesn't  erase  the  erroneous

                                - 30 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

      characters, then you must delete them in the  same  manner  as
      you would any other character in the file.

   2. Most keys on the Super Bee Keyboard will repeat at a  rate  of
      approximately  25 characters per second, if they are held down
      for more than half a second.  This means  that  if  you  press
      <next page>, for example, and hold it down, several pages from
      the file will be displayed.  Thus, forcing you to  wait  until
      all  those  pages  have been diplayed before you can continue.
      To avoid this, do not "lean" on the keyboard,  and  allow  the
      screen  to settle before entering the next command.  Occasion-
      ally you'll lose control of the  cursor;  it'll  start  moving
      accross  the screen in a left to right and downward motion. To
      regain control execute the following procedure:
                       Press     Power Reset
                       Press     Clear
                       Press     On Line
                       Press     Clear

   3. In a previous unit, it was stated that a filename  could  con-
   tain a maximum of 14 characters.  However, this statement now has
   to be slightly altered, since the Rand Editor places the  unmodi-
   fied version of a file into a backup file, and suffixes, .bak, to
   the file name.  It is recommended that the filename contain  less
   than 9 characters to ensure the retention of a backup file.

   4. Since the Rand Editor, as well as the Unix Text Editor,  makes
   no updates to files until a <rub out> is given, it will be unwise
   for more than one user to simultaneously update the same file.

        _D_i_a_g_n_o_s_t_i_c_s


        Below are listed some of the more common errors  encountered
   while using the Rand Editor.  They are terminal-independent.

    1.  "Badkeyerr-editor error."
        Cause:  Self evident.
        Action: Hit another key.


    2.  "Argument must be numeric."
        Cause:  You provided a non-numeric argument  to  a  function
                expecting  a  number. For instance, typing <break> j
                <stroll up> would cause the above error  message  to
                be  displayed  since  the  number of lines must be a
                number.
        Action: Redo the function providing a positive number as the
                argument.



                                - 31 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

    3.  "Argument must be positive."
        Cause:  You provided a negative number to function expecting
                a positive number as in <break> -2 <ins line>.
        Action: Redo the function entering a positive number.


    4.  "Nothing in pick buffer."
        Cause:  You pressed <put> when no lines have been picked.
        Action: Use <pick> to identify the lines to <put>.


    5.  "Can't put a window here."
        Cause:  You placed the cursor in  an  unacceptable  position
                for window creation.
        Action: Position the cursor such that it is along the  left,
                top, or bottom margin.


    6.  "Nothing to search for."
        Cause:  You have  pressed  <+SEARCH>  or  <-SEARCH>  without
                specifying a search key.
        Action: Type <break>, enter an argument for the search key.


    7.  "Search key not found."
        Cause:  The string you specified as the search key (1)  does
                not  exist, or (2) all occurences of the string have
                already been found between the current cursor  posi-
                tion  and  the  file  end.  For <-SEARCH> one of the
                above conditions exists between the  current  cursor
                position and the beginning of the file.
        Action: No action required.


    8.  "Can't make any more parts or windows."
        Cause:  You have tried to create more than 10 windows on the
                screen.
        Action: Discontinue window creation until you  have  removed
                some of the existing ones.


    9.  "You cannot modify this file."
        Cause:  You have tried to alter a file and  you  don't  have
                the write privilege.
        Action: Exit the editor and change the mode of the file.


   10.  "Feature not yet implemented."
        Cause:  You have pressed some combination of keys  that  the
                editor does not recognize.
        Action: Try something else.

                                - 32 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX

   11.  "Nothing in Put Buffer."
        Cause:  You have pressed <break> <PUT> before any  text  has
                been deleted.
        Action: Delete something then repeat <break> <PUT>.


   12.  "Margin stuck, move cursor to free."
        Cause:  You tried to type past the end of the line.
        Action: Move the cursor or move the window by  using  Port<=
                or PORT =>.










































                                - 33 -
   Unit IV                                               Rand Editor







   MP119                                        Introduction to UNIX


                 _S_U_M_M_A_R_Y _O_F _R_A_N_D _E_D_I_T_O_R _C_O_M_M_A_N_D_S

       _S_U_P_E_R_B_E_E             _A_C_T_I_O_N                         _D_E_L_T_A _D_A_T_A
       _C_O_M_M_A_N_D                                             _C_O_M_M_A_N_D

    1. e [+] [name] [n] [nm] invoke Rand Editor.           same
    2. <break>         enter argument                      same
    3. <ctrl B>        enter alternate file, create file   USE
    4. <ctrl V>        make or save file                   SAVE FILE
    5. <ctrl Z>        make a window                       MAKE PORT
    6. <enter> <ctrl C>change a window                     ENTER
    7. <clear>         remove junk characters from screen  CLEAR
    8. <F1>            move the window left                PORT<=
    9. <F2>            move the window right               PORT=>
   10. <F3>            pick                                PICK
   11. <F4>            put                                 PUT
   12. <F5>            forward search                      +SEARCH
   13. <F6>            backward search                     -SEARCH
   14. <F7>            display a particular line           GO TO
   15. <next page>     display next page                   same
   16. <prev page>     display previous page               same
   17. <scroll up>     display next n lines>               same
   18. <scroll down>   display previous n lines            same
   19. <ins line>      insert a blank line                 same
   20. <ins char>      insert mode                         same
   21. <del line>      delete a line                       same
   22. <del char>      delete a character                  same
   23. <home>          move cursor to first line on page   same
   24. <left arrow>    backspace cursor                    same
   25. <right arrow    forward move cursor                 same
   26. <up arrow>      move cursor 1 line up               same
   27. <down arrow>    move cursor down 1 line             same
   28. <rub out>       terminate Editor                    same

   Congratulations! You have completed another  unit  and  it's  the
   last  Unit.   Review the objectives for Unit IV before taking the
   proficiency test.  You have 60 minutes to complete the test,  and
   you may use the Rand Editor summary of commands as a reference.













                                - 34 -
   Unit IV                                           Commands & Test







   MP119                                        Introduction to UNIX


                 _U_n_i_t _I_V _P_r_o_f_i_c_i_e_n_c_y _T_e_s_t



    1.  Explain the command "editor junk 20 5."

    2.  ___________ is used to transfer from the current file to  an
        alternate file.

    3.  What would you type to advance the text in the window:
              a.  10 lines
              b.  15 lines
              c.  23 lines

    4.  The ____________ function would be used to  view  text  that
        extends beyond the edge of the screen.

    5.  How  would you shift all  characters  10  positions  to  the
        right?

    6.  Suppose you want line 230 of  the  current  file  displayed.
        What would you type?

    7.  The ___________ key exits the editor.

    8.  You are  modifying  a  file,  "junk."   What  name  will  be
        assigned to its unmodified version?

    9.  The <home> key is used to:
              a.  move the cursor 1 position to the right.
              b.  move the cursor to  the  first  character  in  the
                  file.
              c.  move the cursor to the top of the page.

   10.  Which key is used to take the terminal out of insert mode?

   11.  What would you type to insert 10 blank lines in your file?

   12.  What would you do to delete  all  characters  following  the
        10th character on a line?

   13.  Briefly state the function of the following keys:
              a.  PICK
              b.  PUT
              c.  +SEARCH
              d.  -SEARCH

   14.  What is the result of typing <break>, then PUT?



                                - 35 -
   Unit IV                                           Commands & Test







   MP119                                        Introduction to UNIX

   15.  What type of data is placed into the alternate buffer?

   16.  Which function allows you to view two or more  files  simul-
        taneously?

   17.  You have divided the larger  window  into  6  smaller  ones.
        What  would you type to reference the file in the 3rd window
        created?

   18.  What would you type to remove the smaller windows  from  the
        screen?

   19.  What would you type to  change  the  name  of  the  file  to
        "junk"?

   20.  What function is used to branch to the end of the file?

   Contact your instructor to  have  your  test  corrected,  and  to
   review  any  topics that you may need help with before taking the
   final examination.
































                                - 36 -
   Unit IV                                           Commands & Test







   MP119                                        Introduction to UNIX


                  _U_n_i_t_I_V _C_r_i_t_i_q_u_e _S_h_e_e_t

   PLEASE!  Just a few minutes of your time.



    1.  It took me approximately  ---------------- hours to complete
        this unit.

    2.  How much experience  did  you  have  before  beginning  this
        course?
              a.  plenty
              b.  some, but not much
              c.  none

    3.  How difficult was the material?
              a.  too hard
              b.  hard, but not impossible
              c.  about right
              d.  easy
              e.  too easy

    4.  How did you like it?
              a.  It was fun
              b.  It was somewhat enjoyable
              c.  It was tolerable
              d.  It was boring

    5.  What did you think of  each  module.  Was  the  presentation
        confusing?
        ModuleI - yes ________    no ________
        If yes, where?________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

        Module II - yes ________   no________
        If yes, where?________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________

        Module III - yes ________   no ________
        If yes, where?________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________




                                - 37 -
   Unit IV                                           Commands & Test







   MP119                                        Introduction to UNIX

        Module IV - yes ________    no ________
        If yes, where?________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________


    6.  Do any sections require more explanation?
        yes________        no__________
        If yes, please help by listing them.
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________


    7.  Were any topics too wordy? ___________
        (please list them)
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________


    8.  Were the objectives clearly stated?___________
        (Please let us know which ones that aren't)
        ______________________________________________________
        ______________________________________________________
        ______________________________________________________


    9.  Did the material cover the objectives? ________________
        (Again we are soliciting your help. Tell us which ones
        weren't covered.)
        _______________________________________________________
        _______________________________________________________
        _______________________________________________________

   10.  What did you think of the amount of exercises?
              a.  too many
              b.  right amount
              c.  not enough

   11.  How well do you think the test evaluated the subject matter?
              a.  completely
              b.  adequately
              c.  poorly






                                - 38 -
   Unit IV                                           Commands & Test







   MP119                                        Introduction to UNIX

   12.  Please list any further comments or suggestions which  would
        help to improve this unit.
        ________________________________________________________
        ________________________________________________________
        ________________________________________________________
        ________________________________________________________
        ________________________________________________________


   **** Please return this to your instructor; you do  not  have  to
       sign it.


   THANK YOU FOR YOUR HELP.






































                                - 39 -
   Unit IV                                           Commands & Test




