💾 Archived View for spam.works › mirrors › textfiles › hacking › primos3.txt captured on 2023-11-14 at 09:57:00.

View Raw

More Information

⬅️ Previous capture (2023-06-14)

-=-=-=-=-=-=-

_______________________________________________________________________________

                  INTRODUCTION TO THE PRIMOS OPERATING SYSTEM
                     Part III (Useful PRIMOS Applications)

                              Written by Violence
                      Copyright (C) 1989 The VOID Hackers
_______________________________________________________________________________


Welcome to Part III of my series on the  PRIMOS operating system.  In this part
I will detail the several  useful appliactions  you are likely to find on Prime
computers.  You will learn about the DSM  (Distributed System Management) util-
ities, the EDIT_PROFILE utility (the PRIMOS user editor), and several others.

_______________________________________________________________________________

EDIT_PROFILE


EDIT_PROFILE is the utility that is used to  add, delete, and modify users on a
Prime computer running PRIMOS.  It is similar to the VAX/VMS AUTHORIZE utility.
There are three modes of EDIT_PROFILE access, and these are:

        o  System Initialization (SI) mode
        o  System Administrator (SA) mode
        o  Project Administrator (PA) mode

You will probably never be using  EDIT_PROFILE in System Initialization mode as
that mode is used for initial  system user setup).  SA mode will allow to perf-
orm wholesale user modifications,  whereas PA mode will only allow you to perf-
orm modifications to users in the same project as you.  When you decided to try
out EDIT_PROFILE on the system that you have hacked into, type this:

        OK, edit_profile

If it gives you an error message then you obviously don't have good enough pri-
vileges.  Don't give up hope,  however, as there are ways around this.  Unfort-
unantly,  though,  the methods which you must use are  beyond the scope of this
tutorial.  It involves programming in a high level language (FORTRAN IV, FORTR-
AN-77,  PL/1 Subset G, et. al.)  as well as knowledge of the appropriate system
calls to make.  Do lots of research and experiment.  You might just get lucky.

If, on the other hand, it allows you to invoke EDIT_PROFILE  then it will disp-
lay the utility's herald (revision number,  serial number and copyright inform-
ation)  and a message stating what  mode you are in.  The mode message  will be
one of these:

        In system administrator mode
        In project administrator mode

If you are in SA mode then the account you are using has SYS1 privileges (thats
the best you can do from a remote standpoint).  Before I get deep in how to use
EDIT_PROFILE properly I should mention that I have the source code to this won-
derfully useful program and  a security  audit feature was  added in during the
last few years  (circa 1986).  It will log all  successful and failed commands.
The only ways I have discovered around this is to remove the logging procedures
from the code and recompile it online, but that's pretty advanced stuff and not
advised at any rate.  The best you can do at maintaining  your  presence on the
system is not to use  EDIT_PROFILE  overly much.  In fact,  don't use it unless
you must.  I generally use  EDIT_PROFILE once per hack, and that is after I get
in.  What do I do?  I obtain a full  user/project  listing  for future  hacking
purposes.  You can't obtain an account's password from within EDIT_PROFILE, but
you can obtain a full user  and project listing,  as well  as add,  modify  and
delete users.  If you get a  user list,  try and hack at  those accounts before
wontonly adding  user accounts.  Be sensible.  Get all that you can before add-
ing a user.  And if you must add a user, just add one.  There is no need to add
3 or 4 users.  No need at all.  One user is easier to hide than 3+.  Use common
sense here, guys.

Once EDIT_PROFILE  has been invoked you  will be dispatched  mercilessly to the
">" prompt.  To obtain help, just type HELP and press RETURN.  Before I get in-
to adding users, I'll discuss the procedures for pulling user lists and similar
information.

To get full information about the system you are on  (projects, users, etc) you
simply need to type:

        >list_system -all

You can abbreviate the  LIST_SYSTEM  command with  LS.  You can list individual
system attributes by substituting new  arguments in place of the -ALL argument.
To see what LS arguments are available,  type HELP.  You should experiment with
the available "LIST_" commands in EDIT_PROFILE.

Before attempting to add a user on any Prime  system you should always list the
system  attributes so that you will  know what projects and  groups are in use.
When you decide to  add a super-user,  make sure  that you add  yourself to the
common project (usually DEFAULT) and all of the high-access groups  (examples I
have  seen  are:   .ADMINISTRATORS$,   .PROJECT_ADMINISTRATORS$,   .OPERATORS$,
.NET_MGT$,  etc).  Adding  super-users is  not always  a  good idea.  Never add
more than 1 or 2 users on a system.  Also,  try to  follow the  naming convent-
ions used on  the  system.  If users have their  first name as a User ID,  then
when you add a user  make sure that  your new user's  User ID is  a first name.
Likewise,  if all users  have their initials  as their  User ID  then make sure
that your  new user has a User  ID with initials.  Now, to add a user, type:

        >add_user username

Where  "username" is the User ID you wish to use.  After you type this you will
be asked for your password.  Enter the password that you wish to use.  Then you
will be asked for  your group(s)  and your default login project.  Like I said,
you should use the "LIST_"  commands to see  what group(s)  are in use.  Groups
always start with a period (.).  Give yourself the administrator groups and you
will be doing good.  As for project,  an entry of DEFAULT will usually suffice.

An easier method to add users is to use the -LIKE argument.  Try this:

        >add_user username -like system

Again, "username" is the name of the  User ID  that you wish to use.  This arg-
ument of the ADD_USER command will make a copy of the user called SYSTEM (found
on all  Primes that I have seen;  also a user of the super-user class)  and add
the copy as a new user but with a different name.  Now,  set your password with
the CHANGE_USER command.  Type:

        >change_user username -pw

You will be  prompted for your  new  password.  Ta da.  You now have a  User ID
with the same stats as the User ID "SYSTEM".  Occasionally  upon adding a  user
you may have to add your User ID to a file called  LOGUFD located in one of the
UFD's off of MFD 0.  This will  generally not happen.  If it does,  then simply
correct it with one of your other accounts.

You are advised not to wontonly delete users or edit them.  Also try not to use
the CHANGE_SYSTEM_ADMINISTRATOR command.  In basis, type HELP and start to exp-
eriment (but be careful of what you do).  Make sure that  you keep track of the
changes that you make so that in the case you mess something up you can fix it.
Get your feet wet.

If you find yourself in PA mode you can do most of the above,  but only regard-
ing the project  that you are  administrating.  Thus you can  only add users to
that project, only delete users from that project,  etc.  This means  no adding
of super-users, etc.

_______________________________________________________________________________

THE DISTRIBUTED SYSTEM MANAGEMENT (DSM) UTILITIES


The DSM utilities is a set of commands and services  that help with the admini-
stration and  day-to-day operation of  Prime  computer systems.  It is intended
primarily for use with networked systems,  but can also be used on single Prime
systems (those lacking networking capability).

The DSM utilities  allow Prime  system administrators  and  senior operators to
perform system management tasks from any point on a network.

DSM's main facilities are summarized below.

     o  SIM (System Information/Metering) Commands
            System status and resource monitoring of local and remote
            systems from any point within the network.

     o  RESUS (REmote System USer) Facility
            Control of remote Prime systems from any terminal.  Allows use of
            console-only commands from a remote terminal.

     o  Collection and collation of event messages, including PRIMOS and
            network events, through DSM's Unsolicited Message Handling (UMH)
            and logging services, with redirection of event messages to
            log files or users throughout the network.

     o  Generalized logging of DSM messages in private or system logs, with
            commands for administering, displaying and printing logs.

     o  Facilities for defining users' access to DSM commands throughout the
            network, in a single configuration file.

As you can see,  the DSM utilities can be a very useful asset to have.  Unfort-
unately, SYS1 privileges (administrator)  are required to use the most exciting
aspects of the  DSM utilities.  All normal users can utilize the  SIM commands,
and I have even mentioned some of them  in other parts of this series.  What is
really useful to us,  however,  are the RESUS and log utilities.  In a nutshell
here are the  basic DSM commands.  After this list will  be full  discourses on
the RESUS utility and the SIM commands.


Remote System Control:

  RESUS -- Invokes Prime's REmote System USer facility.

Event Message Handling and Redirection:

  CONFIG_UM -- configures DSM Unsolicited Message Handling.

Administering Logs:

  ADMIN_LOG -- creates and administers DSM log files.

Displaying and Printing Logs:

  DISPLAY_LOG -- displays and prints the contents of log files,
       including system and network event logs.

DSM Configurator Commands:

  CONFIG_DSM -- creates a new DSM configuration file.
  DISTRIBUTE_DSM -- distributes a new DSM configuration file.
  STATUS_DSM -- displays the currently active configuration.

DSM Startup and Shutdown Commands:

  START_DSM      - starts DSM system console commands.
  STOP_DSM       - stops DSM system console commands.

For more information on any of the DSM commands, type:

  HELP command-name  or  command-name -HELP

_______________________________________________________________________________

THE RESUS UTILITY


RESUS is the  REmote System USer facility,  and allows remote operation  of the
physical supervisor  console from  any terminal.  What this basically  means is
that, with RESUS enabled, all users with  administrator access  will be able to
execute commands that are normally only executable from the system console.  It
will let you force log other users off the system  (not a good idea to use this
capability unless  you MUST),  take the system down  (you must be  STUPID to do
such a thing), etc.  RESUS supports the following command line options:

           {-ENABLE                   }
           {-DISABLE [-FORCE]         }
           {-START [-ON node name]    }
           {-STOP                     }
           {-STATUS [-ON node group]  }
           {-HELP  [-NO_WAIT]         }
           {-USAGE                    }

  -ENABLE
       This option enables RESUS to be used on a system. It is only
       valid from the supervisor terminal.

  -DISABLE
       This option is used to prevent RESUS from being used on a system on
       which it has previously been -ENABLEd. The -FORCE option must be
       supplied if the RESUS is actually in use. It is only valid from the
       supervisor terminal.

  -START [-ON node name]
       This is the means by which an authorised user of RESUS may
       invoke REmote System USer facilities on a system. If -ON node name
       is omitted, the default is the local node. For this command to be
       successful, RESUS must previously have been -ENABLEd at the
       supervisor terminal.

  -STOP
       This option terminates remote control of the supervisor terminal,
       leaving the REmote System USer facilities available for use by
       other authorised users. It is only valid from the remote terminal
       in control of the supervisor terminal through RESUS.

  -STATUS [-ON nodegroup]
       This displays the current status of RESUS on all nodes in a
       specified node group. If a node group is not specified, the status
       of the local node is displayed.

  -HELP, -H [-NO_WAIT, -NW]

       Displays command-specific Help text.

  -USAGE

       Displays command line syntax.

_______________________________________________________________________________

THE DSM SIM COMMANDS


The  DSM  SIM   (System  Information/Metering)   commands  gather  and  display
information about  system/network  status and resource  usage from any point on
the network.

SIM  commands are  invoked from  the  PRIMOS command line.  They can be invoked
from any terminal to display information about any system on the network.  They
can be  invoked  once,  or periodically  at specified  time  intervals.  Output
displays  are  paginated for  screen display  and can be recorded in private or
system log files.  User access to  SIM commands  on local  and  remote nodes is
controlled by DSM security.

A list of SIM commands and descriptions of the general SIM options follows.

LIST_ASSIGNED_DEVICES      -  lists assigned devices
LIST_ASYNC                 -  lists asynchronous terminals
LIST_COMM_CONTROLLERS      -  lists comms controllers configuration
LIST_CONFIG                -  lists PRIMOS coldstart configuration
LIST_DISKS                 -  lists disk partition names
LIST_LAN_NODES             -  lists nodes on LAN300 local networks
LIST_MEMORY                -  lists physical memory usage
LIST_PRIMENET_NODES        -  lists PRIMENET configured nodes
LIST_PRIMENET_LINKS        -  lists active PRIMENET links
LIST_PRIMENET_PORTS        -  lists assigned PRIMENET ports
LIST_PROCESS               -  lists active system processes
LIST_SEMAPHORES            -  lists active semaphores
LIST_SYNC                  -  lists synchronous line configuration
LIST_UNITS                 -  lists users open file units
LIST_VCS                   -  lists active virtual circuits

General SIM options are:

        -HELP, -H [-NO_WAIT, -NW]
        -USAGE
        -ON {node, nodegroup}
        -PRIVATE_LOG, -PLOG pathname [-NTTY, -N]
        -SYSTEM_LOG, -SLOG pathname [-NTTY, -N]
        -NO_WAIT, -NW
        -FREQ integer
        -TIMES integer
        -START, -S date+time
        -STOP date+time

    -ON {node, nodegroup}

       This option  allows you to specify the target node, or nodegroup
       to which the command is to be directed. The default is to direct
       the command to the node on which the command is invoked.


    -PRIVATE_LOG, -PLOG  pathname [ -NTTY, -N ]
    -SYSTEM_LOG, -SLOG   pathname [ -NTTY, -N ]

       The -PRIVATE_LOG  option allows you to specify a standard PRIMOS
       pathname as a DSM log file to which all messages from the target
       nodes are to be logged. If the log does not already exist, it is
       created automatically for you.  User DSMASR (the DSM application
       server) must have ALL access to the directory that contains  the
       log.

       The -SYSTEM_LOG  option allows you a similar facility using logs
       that are maintained on the system logging  directory  DSM*>LOGS.
       System logs  only exist on this directory or its subdirectories,
       and must be created with the ADMIN_LOG command prior to use.

       Logged data   can   subsequently   be  retrieved,   printed  and
       displayed using the DISPLAY_LOG command.

       -NTTY, -N; can be used with  the  -PRIVATE_LOG  and  -SYSTEM_LOG
       options, and indicates that no data is to be  displayed  to  the
       user.  When  this option is used, the command spawns  a  phantom
       which  executes  the  command  on  your behalf, and  frees  your
       terminal.


     -HELP, -H [NO_WAIT, -NW]

       This  option overrides all other options to display help
       information about the associated command.


     -USAGE

       This option overrides all other options  to  display usage
       information, for the associated command.


     -NO_WAIT, -NW

       This option indicates that you are not to be prompted or queried
       during the command output display.

       If this option is not used, you are prompted between each target
       node's response,  and  after  every  23 lines (1 page) of output
       displays  '--More--'  and  waits, for your response. To see more
       output press the carraige return. To supress further output  and
       return  to  command  level,  type  Q, Quit, N, or  No. Any other
       response will display more output.

     -FREQ
       -TIMES
       -START, -S
       -STOP

       These options can be used to implement periodic execution  of  a
       command.

       -FREQ  option  provides  periodic  execution of a  command, with
       the interval  between  executions  determined  in  seconds.  The
       interval you specify is  the  interval  between  two  successive
       executions of a command, and not the interval between completion
       of the command's display and the next execution. The interval is
       corrected to the nearest multiple of  four  seconds  below  that
       specified.If FREQ  0  is  specified,  the command is re-executed
       immediately on completion of the  previous  execution.   If  the
       interval elapses before completion of the previous display,  the
       next execution is delayed until the display is complete.


       -TIMES  is  used in association with the -FREQ option, to set  a
       limit on the number of times that a command is to  be  executed.


       -START, -S sets the  date  and  time  that execution starts.  The
       format can be in either ISO standard:

           (YY_MM_DD.HH:MM:SS)

       or in USA standard:

           (MM/DD/YY.HH:MM:SS)

       Defaults are:  year to current year;  date to current date;  and
       time to zero.

       -STOP  sets  the date and  time  execution  stops;   format  and
       defaults are the same as for -Start.

       In the  absence  of  any  of  these four options, the command is
       executed once, and immediately.

       In the presence of any  of  these  four  options,  the  defaults
       applied to the unspecified options are:

           -FREQ   immediate reexecution
           -TIMES  infinite
           -START  now
           -STOP   never


For more information on any of the SIM commands, type:

    HELP command-name   or   command-name -HELP

_______________________________________________________________________________

PRIMOS ELECTRONIC MAIL CAPABILITIES


PRIMOS, like any other operating system worth it's beans,  supports full elect-
ronic mail capabilities.  However,  the mail system used  will vary from system
to system.  A lack of  standards?  Perhaps.  But I  find it enjoyable  learning
the differences between the many mail systems available.

I won't discuss how to use the mail systems I discuss due to lack of space, but
that should pose no problem, as all of them have online help available.

Prime Computer, Inc.'s old mail system (invoked by typing MAIL) is your typical
run-of-the-mill mail system.  It's not too difficult to  figure out how to use.

Prime Computer, Inc. has also created a PRIMOS implementation of the UNIX XMAIL
system.  This seems  to be their  preferred electronic mail system.  It is very
easy to use, not to mention very powerful.

My favorite electronic mail server is NETMAIL,  written by those  cunning prog-
rammers at Bramalea Software Systems (the same firm that created LOGIN_SENTRY).
NETMAIL is the mail server with the most useful features.  Not only do you get
the normal features of sending user-to-user mail locally and to similarly con-
figured sites on the network, you can also send:

        o  Courtesy copies to other users
        o  Encapsulated non-SAM files

Courtesy copies is basically message forwarding.  Assume I wrote  a memorandum.
If I wanted all the people on the 'Board of Trustees' to get a copy I just send
cc's (courtesy copies) to them.

The file encapsulation feature makes NETMAIL a pseudo-file transfer application
like FTS (File Transfer Service,  Prime's answer to UNIX's FTP utility).  Say I
wrote a useful public domain program and want to distribute it to some users on
the local system and  some remote systems.  Don't want them to get the sources,
now do we?  So we encapsulate the executable file  (compiled program)  and mail
it out as an encapsulated file.  When the recievers read their mail,  they will
be able to tell NETMAIL to save it as a file to their directory.  Very nice!

Some sites use  custom-written  mail utilities.  It all depends.  Most,  if not
all, are rather  user-friendly and easy to  learn without documentation.  Don't
forget!  Online help files.

_______________________________________________________________________________

ED - THE PRIMOS TEXT EDITOR


ED is the PRIMOS text editor and it is line-oriented as opposed to full-screen.
If you are using VT-100 or a similar emulation,  you might play around with the
EMACS full-screen editor, but I won't be discussing EMACS here.  After all,  it
comes with it's own interactive tutorial.  Another reason why I won't be discu-
ussing it is because  not all  Prime sites  have it online  (it is a separately
priced  product).  RUNOFF is another separately  priced product.  It is a fully
equipped word processor.  ED,  on the other hand,  comes with PRIMOS and  it is
always available.

To invoke the PRIMOS EDitor, type:

        OK, ed

This will  enter  ED with an empty workspace.  You are creating a new file.  To
edit an existing filesystem object, type:

        OK, ed filename

When you enter ED with an empty workspace you will be dumped into  INPUT  mode.
Everything you type here will be taken as input into the file you are creating.

If you tell  ED to load a file and edit it  (ie, ED filename) then you will be
dumped into EDIT mode.  Everything you  type will be taken  as ED editing comm-
ands.

To switch between INPUT and EDIT mode, issue a null line (that is to say, press
the RETURN key).  This brings a new problem into mind.  How do you make a blank
line if when you press RETURN alone it switches between modes?  Yes,  this is a
shortcoming to PRIMOS users that are used to standard text editing systems.  To
create a  'null' line,  type a space and then press RETURN.  It looks null, but
it is really  treated as a  line 1  character  in length by ED.  Take note that
both INPUT mode and EDIT mode use no prompt.

Ok, to illustrate what we have learned so far,  consider this 'pretend' session
with the ED line editor:

        OK, ed
        INPUT
        Hey, this is pretty nice.  A nice text editor.  Heh.  Ok, lets see what
        Damn!  No wordwrap.  Remember, press RETURN at the end of each 79
        characters, ok?  Now, lets go to EDIT mode...

        EDIT
        wow
        BAD WOW
        
        INPUT
        oops!  'wow' is not an ED command!  I'll discuss ED's EDIT mode
        commands in a few minutes.  Let's quit!

        EDIT
        q
        FILE MODIFIED OK TO QUIT? y
        OK,

Okay, we are back at the PRIMOS command line.  Damn!  We forgot to save our
newly-created text!   What do we do now!  Don't panic.   Your text is still
floating around in PRIMOS' memory.  To restore your ED session, type:

        OK, start 1000          <-- Continues from break

            or

        OK, start 1001          <-- Resume in EDIT mode

So, let's test it out, shall we?

        OK, start 1001

        EDIT
        file sample_text
        q
        OK,

Alright.  A few  comments are now in order.  Normally,  when done with a  docu-
ment you would FILE the text away and then QUIT.  If you try and QUIT without
saving new text or changes made to text, you will be told that the file has
been modified and asked for verification to quit.  Should you make a 'boo-boo'
you can save your text by using one of the START command variations.  The two
EDIT mode commands we have just learned are:

        FILE    (abbreviated FIL)       Files your text to the current UFD
        QUIT    (abbreviated Q)         Exit ED to the PRIMOS command line

An alternate command to save your text is the SAVE command (abbreviated by SA).
I prefer  SAVE  to  FILE  because SAVE  is also  used on my microcomputer.  Use
whichever you prefer, however.

A great feature of the START command will now be illustrated.  Say you are mov-
ing around UFD's and you end  up trying  to create  a file  in a directory that
you don't have W (Write) access in.  Oh no!  How do we  save this new CPL prog-
ram we just created?  Simple!  Using techniques  that you have just learned you
can move to a different UFD  (one that you have W access in) and save your text
in.  First,  get into EDIT mode and  QUIT  the EDitor.  From the PRIMOS command
line, use the OR command to get to your 'home' UFD or ATTACH to a different one
and then issue the  START 1001  command.  Now  FILE  your text.  Voila!  A nice
trick for the forgetful.

We now know the very basics of the PRIMOS line EDitor.  We can create new files
from scratch, append text to existing files,  save or abort our  modifications,
and recover our text if we  accidentally quit or hit the BREAK key  (or send  a
BREAK signal).  What we don't know is  how to edit  the text within an existing
file or how to insert/delete text from an existing file (which is really easy).
So read on!

CAVEAT!  PRIMOS normally uses the  '?'  and  '"' (double quote) as the kill and
erase characters,  respectively.  So typing a  '?'  in INPUT mode will kill the
entire line.  A  '"'  will similarly erase the previous  character.  I find the
'?' and '"' characters integral in my documents and you will probably too.  The
fix?  Simple.  From the PRIMOS command line, type:

        OK, term -erase <Ctrl-H>
        OK, term -kill _

Press  CONTROL-H  where it says '<Ctrl-H>'.  This will make the erase character
a backspace  and the kill  character the DELETE key.  Substitute whatever char-
acters  you feel most  comfortable with  on your microcomputer.  I will  detail
the  TERM  command  more fully in  Part V  in the section entitled  CUSTOMIZING
YOUR ENVIRONMENT.

Another caveat.  The semicolon character at the end of a line  (';') will force
a linefeed (as if you had pressed  RETURN  instead).  You  can  end a line with
either RETURN or a semicolon  (useful if your  RETURN  key is broken?).  If you
enter a line of text containing semicolons such as this:

        line one;;line three

ED will take it and output it as this:

        line one

        line three

instead of:

        line one;;line three

Depending upon  the location  of the semicolon  it may produce a  linefeed or a
mode switch.  Thus, the line of text:

        This is a caveat;

will switch you from  INPUT  mode into  EDIT  mode.  Avoid having semicolons at
the end of a  line of text.  I will detail  the method you  will have to use to
get around this if you want to have semicolons in your file.

Should you wish to edit/insert/delete lines of text within an existing file you
will have to learn how ED  addresses text in it's buffer.  I'll assume that you
have loaded a file into ED and are in EDIT mode.  The basis of our example:

        OK, ed example_file
        EDIT

Ok, now let's view the entire file:

        p 9999
        .NULL.
        This is the text of the file we are using in our example.
        I will change this file around so that you will see how
        to edit/add/delete text in a file.
        .NULL.
        BOTTOM

This example used  'P 9999'  to display the contents.  'P'  is the abbreviation
for the PRINT command.  So you see, I told ED to PRINT the first  9999 lines of
the file in it's buffer.  PRINT displays the specified number of lines (9999 in
the example) and makes the last line displayed the'current' line.

The .NULL. is not a part of  the file,  but rather a  marker.  It marks a place
where you can insert text.  BOTTOM indicates  that you are at the bottom of the
file.  Should you type PRINT (or P) again it will simply say:

        .NULL.

You can type PRINT  (or P)  by itself without a numeric  argument.  PRINT has a
default value of 1.  Conversely, a PRINT -n  ('n' being a whole number) command
will cause ED to display the file backwards.

To get to the top or bottom of a file, type:

        top                             <--- Abbreviation is T

        or

        bottom                          <--- Abbreviation is B

Very simple.  To see what the line number of the  current line you are pointing
to is, type:

        where
        BOTTOM

Since we  did that PRINT 9999  command we are at the BOTTOM of the file.  Let's
go to line 2.  Type:

        point 2

This will set the  ED  pointer to line number 2.  ED will tell you that you are
at line 2 by displaying  line 2  on your screen.  You can abbreviate the  POINT
command by typing PO instead.  Now try the WHERE command  (it also has an  abb-
reviated form, which is W).  Type:

        w
        LINE  2

Ok, we now  know how to move around  in a file  and display  some or all of the
lines of text it contains.

The NEXT command (abbreviated by N) will move the pointer to down the specified
number  of lines towards  the BOTTOM of the file  (assuming that  the specified
number is positive).  Negative numbers will move the pointer up.  As per the PO
command, the new pointer line will be displayed.  Here are two examples:

        n 1
        to edit/add/delete text in a file.
        n -2
        This is the text of the file we are using in our example.

To find text in the bufferm use the LOCATE command  (abbreviated L).  For exam-
ple, to find the string 'change this file' type:

        l change this file
        I will change this file around so that you will see how

Now look and see where you are.  Type:

        w
        LINE  2

Aha!  The  LOCATE  command not  only finds the  specified string,  but sets the
pointer to  the new line.  Now, try and LOCATE the string 'Aunt Jamima'.  Type:

        l Aunt Jamima
        BOTTOM

ED could not find the string in the text.  The new pointer  is BOTTOM,  meaning
that you are at the last line in the file.

Similar to LOCATE is the FIND command (abbreviated F).  FIND only checks to see
if the specified string is at the beginning of a line (ie,  the first character
is in column 1, the second in column 2, and so forth).  Here is an example:

        find to edit/add
        to edit/add/delete text in a file.

As with LOCATE, FIND displays  the line and resets the pointer to its  new loc-
ation.  If the string is not found FIND returns with BOTTOM and sets the point-
er to the bottom of the file.

NFIND is a similar command which works in the opposite manner of the FIND comm-
and.  NFIND  (abbrevated NF)  will locate the first line below the current line
which does not begin with the specified string.  In the following example, I'll
display use of the  NFIND  command as well as display the method you may use to
have multiple ED commands on one line.

        EDIT
        p3
        .NULL.
        This is the text of the file we are using in our example.
        I will change this file around so that you will see how
        to edit/add/delete text in a file.
        top, nfind This is
        I will change this file around so that you will see how

As you can see,  NFIND  only finds the first line that  does not start with the
specified string.  Also note the use of  the comma as a command delimeter  when
issuing the TOP and NFIND commands.  Just like with LOCATE and FIND, NFIND will
also return BOTTOM and set the pointer to the end of the file if it cannot find
a line not starting with the string you specify.

You can also FIND and NFIND string patterns on a line starting at a column pos-
ition other than 1.   The format for this option is displayed below:

        f(8) change this file
        I will change this fie around so that you will see how

The parenthesis are required and there cannot be any spaces between the command
and the (#).

To append text to the end of the current line, use the APPEND command (abbrevi-
ated with A).  To append '  02/24/89.'  to the end of the last line,
type:

        po3
        to edit/add/delete text in a file.
        a   02/24/89.
        to edit/add/delete text in a file.  02/24/89.

You must have a space between the  APPEND  command  and  the string you wish to
append.  If you had instead typed:

        a 02/24/89.

you would have gotten:

        to edit/add/delete text in a file.02/24/89.

Use the CHANGE command (abbreviated C)  to change a string in the current line.
The first character after the CHANGE command is used as the delimeter.  This is
a more complicated command than most other ED commands.  Format:

        CHANGE/string-1/string-2/[G] [n]

'string-1' is the original string and 'string-2' is the  replacement string.  G
specifies a global change.  If G is ommitted then  only the first  occurance of
string-1 will be changed.  'n' is a  pointer value.  If it is  0 or 1  (default
values) then the change will be made to the current line (assuming the G option
is not in use).  If 'n' is a  value other  than 0 or 1 then ED will inspect and
make changes on 'n' lines starting at the current line.  As sual, ED will reset
the pointer to the last line inspected.  Should the file contain fewer than 'n'
lines then ED will make the specified changes in all the lines  of the file and
end by saying BOTTOM.

Should you wish to change a string containing slashes ('/'), CHANGE's delimeter
character, then substitute a new delimeter character.  Examples:

        f 02
        to edit/add/delete text in a file.  02/24/89.
        change:02/:01/:
        to edit/add/delete text in a file.  01/24/89.
        c#/#-#
        to edit/add/delete text in a file.  01-24-89.
        c/01-24/24-Feb/
        to edit/add/delete text in a file.  24-Feb-89.

You should always issue the TOP command prior to making global file changes.

To insert characters at the beginning of a line, use CHANGE like this:

        po3
        to edit/add/delete text in a file.  24-Feb-89.
        c//Last Line --> /
        Last Line --> to edit/add/delete text in a file.  24-Feb-89.

Remember our dilema  with the semicolon character  (';')?  Say you want to have
semicolons in your file.  Lets put a  semicolon in our file.  First,  lets mark
where we want ED to put the semicolon.  Do this:

        po3
        Last Line --> to edit/add/delete text in a file.  24-Feb-89.
        c/.  24/@ 24/
        Last Line --> to edit/add/delete text in a file@ 24-Feb-89.
        top, c/@/;/g9999
        Last Line --> to edit/add/delete text in a file; 24-Feb-89.

If you know where you want your semicolons from the start then just use a char-
acter that you don't plan on using elsewhere in the file (like the '@' charact-
er) and place them where you desire.  Then perform the above procedure.  Voila!
Instant semicolons when you thought it couldn't be done.

To delete commands from a file, use the DELETE command (abbreviated with D).  I
believe I don't like the second line of our example file.  Let's delete it.  To
do this, type:

        po2
        d
        top
        p9999
        .NULL.
        This is the text of the file we are using in our example.
        Last Line --> to edit/add/delete text in a file; 24-Feb-89.
        .NULL.

No more line 2.  As with other  ED  commands,  DELETE  deletes from the current
line.  DELETE 1  will not  delete the  first line  of the file,  but rather the
current line.  DELETE 5  will delete the fifth line from the current line (with
starting line being the current line).

The last ED command I will go over is the RETYPE command  (abbreviated with R).
RETYPE  will delete tge current line and replace it with the  specified string.
Notice that  the text of our  example is now nonsensical.  The second line is a
sentance fragment.  All hackers should spell correctly  (grin).  Let's fix this
grammatical error.

        po2
        Last Line --> to edit/add/delete text in a file; 24-Feb-89.
        r Now you will learn how to edit/add/delete text in a file.
        Now you will learn how to edit/add/delete text in a file.

RETYPE followed by a  space and a  RETURN  will delete the  current line.  This
will make a  'null' line.  This can be used as an alternate method for creating
'null' lines (to delimit paragraphs in your text) as opposed to making the line
a blank space.

Let's look at both the original example file and its present form:

ORIGINAL:

        This is the text of the file we are using in our example.
        I will change this file around so that you will see how
        to edit/add/delete text in a file.

CURRENT:

        This is the text of the file we are using in our example.
        Now you will learn how to edit/add/delete text in a file.

The most useful means of using ED is to upload text  (documents or sources)  to
the host Prime.  Simply load in the file on your microcomputer and go into your
terminal program's editor.  Change all occurances of a null line to a space and
a RETURN.  Now enter ED and upload your file via the ASCII protocol.  You might
need to lower the sending speed (the line delay) if you seem to be sending text
too fast for ED to get it.  When done with the send, just enter  EDIT  mode and
SAVE or FILE the text.


WARNING: If the filename you specify ED to save your text as exists in the cur-
rent UFD then ED will overwrite the file with the text in its buffer.  Be care-
ful not to use an existing filename when you save files or you might be sorry.

Now for some important notes on PRIMOS filenames.

1. Filename can be up to 32 characters long.
2. Filenames can only contain the following characters: A-Z, 0-9, & - $ . _ / #
3. The first character cannot be a number.
4. No embedded blanks or special characters (like [ ] ( ) { } etc).
5. All characters are mapped to UPPER CASE by PRIMOS.

Legal Filenames                         Illegal Filenames

MYFILE                                  MY FILE
TODAYS-SYSTEMS                          SYSTEMS?
$MONEY                                  4MONEY
TEXT_FILE                               ACCTS@PRIME
PRIMES&VAXEN                            "COOL"

NOTE:  ED does  not  like TABs!  Do not use  your terminal's  TAB key!  ED will
not understand them.  To tell ED to use a TAB, use the backslash  ('\') charac-
ter.  Example:

        tab\this\out\for me.

is interpreted as:

        tab   this   out              for me.

EDitor has many other commands.  Type  HELP ED  to obtain a list of them  and a
brief statement of each one's function.

Question: Ever see a more detailed description of how to use a text editor on a
          mainframe in a 'how-to-hack-this-op/sys' type of file?

_______________________________________________________________________________

EXPERIMENTATION WITH OTHER PRIMOS APPLICATIONS AND UTILITIES


There are  many other  applications that you will find on Primes.  Some of them
useful and interesting, some of no use whatsoever to the hacker.  I can't begin
to describe  them here.  This part  of the series is  already larger than I had
planned, so I am going to have to end it here.  Here is a very  incomplete list
of applications commonly found on Prime computer systems:

PRIME INFORMATION       A database system
PRIME WORD              A word-processing system
MIDAS                   A graphics design utility
TELL-A-GRAF             A graphing utility
ORACLE                  A database system

There are tons more application systems to be found on Primes.  Experiment!  It
is best to experiment with available applications to see if they can be useful.
Read people's  word processing documents,  see what's in their database.  Never
know what you might find!  Just be careful not to delete or change anything!

In the next installment of this series I will detail the networking utilities &
software available for the  Prime computer.  I will  cover the  network-related
SIM commands, the NETLINK utility, PRIMENET, and more!  Look for it.

     May the forces of darkness become confused on the way to your house.

_______________________________________________________________________________

     End of Part III of the "Introduction to the PRIMOS Operating System"
_______________________________________________________________________________