

                   TIPS FOR USING THE CLI - Part 2
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




SECRETS OF THE "TYPE" COMMAND

TYPE is a most versatile command in the CLI (Command Line Interface), and
can be used to great advantage in sorting out the types of files that you
may be confronted with on Public Domain directories and elsewhere.

The normal use of TYPE is simply to print a file on the screen, normally 
text (ASCII characters). So at the CLI prompt, just enter
         > Type Filename
and you'll see the screen fill with text and it'll scroll by rapidly. To 
halt this process, simply hit a key, say the Space bar. To continue, hit
any other key. And to quit the file display, hit  CTRL-C, then RETURN.

To print a file to your printer, simply enter
         > Type filename to prt:
having made sure your printer is on and loaded with paper.

To get a file displayed on screen with line numbers down the left hand
side (useful when programming, or checking the length of a file), enter
         > type filename opt n
or to get the same to your printer
         > type filename to prt: opt n

Now, say you've found a program somewhere with no documentation or file
extension (like filename.c) or anything else to indicate what it is, or
what state it is in. That is, it may have been downloaded from a BBS 
untidily, and doesn't work at all, and perhaps even hangs the machine 
if entered in the CLI. But you have to know what it is! and perhaps even
resuscitate it. Enter 
         > type filename opt h
and you will get what is called a "Hex dump" of the file, which means 
that the file will be displayed on screen as a number of rows of 
hexadecimal numbers on the left side, and its text equivalent on the
right (if there is a text equivalent - it might be all code). E.g. -

0000: 000003F3 00000000 00000000 00000000    ...............
and so on for any number of rows, depending on the size of the file.
In this case, the "000003F3" indicates a "Hunkheader", ie, the start
of an executable program. So the problem could well be that the 
program still has some extra characters attached as padding while 
it was downloaded. There are Public Domain programs called  FIXOBJ
and CHOP which are designed to strip extra characters from programs.

If you saw "000003E7" at the start of the hexdump, you'd know you 
had an OBJECT FILE, ie, the output of a language compiler.

Another problem is that a text file from a non-Amiga source may have 
extraneous characters embedded. The Amiga uses only LINEFEEDS to 
move to the next line, and the hex for this is "0A", which you'll
see at regular intervals in the hex dump. If you see "0D0A" recurring
you'll know that you have Carriage-Returns (0D) followed by LineFeeds
(the system used by IBM PC's)and this will certainly cause problems.
The utilities  "RemCr" and STRIP both knock out the 0D characters,
thereby fixing the problem.

Similarly a text file downloaded from a Macintosh will have only 
Carriage Returns (0D). The "13to10" utility will replace the 0D (decimal
13) with 0A (decimal 10).

A bit of experimenting will soon familiarize you with these processes,
and you might find it worth your while to get some of the Utilities
mentioned.  MEGADISC will organize these or any other Public Domain 
programs for you - look for the information in the SUBS&EXTRAS drawer.


                       USING THE ASSIGN COMMAND
                       ~~~~~~~~~~~~~~~~~~~~~~~~

    This is another powerful CLI command, and has various uses. It allows
    you to give shorter names to often-used files, keeps track of what
    "logical devices" are available and their assignations, lets you
    import other fonts, change the running of your session to another disc,
    and so on.

    * Creating aliases:
      If you find you're often referring to a particular file, be it a
    CLI command or a text file or whatever, you can use ASSIGN to give it
    a shorter name. So say you often have to type "df1:letters/myletter"
    in the course of your session - simply enter
                          > assign z: df1:letters/myletter
    and for the rest of the session, you can refer to that file as  [z:]
    (without the brackets). If you reboot, any such assignations are lost.
      If you want to remove any particular assignation, just enter
                          > assign z:
    and you're back to the original situation.
      If you want to set up particular assignments for each time you use
    your WorkBench, you'll have to include them in the Startup-Sequence in
    the   s   directory, which means editing it via ED, the CLI text
    editor. Enter
                          > ed sys:s/startup-sequence
    and you'll then be in ED. Use the arrow keys to move down to, say, the
    line before  "loadwb", cursor to the end of it, [Return] to get a
    blank line, and then type in the Assignations that you want to make.
    Then to exit and save your changes, press [esc], type x, and [return],
    and that's it. From now on those assignations will be made each time
    you boot up that disc.

    * To see the Assignments as they currently are on your system at any
    time, simply enter    > Assign
    and you'll get a list of them. For example the "logical device" FONTS:
    is assigned to  df0:Fonts, ie, the directory containing your system
    fonts.  These assignments can be changed if you want, and it is useful
    to do so in some cases:
      _ If you want to make up some pretty notes in NotePad, and you've
    got a series of fonts on your disc in the external drive which you'd
    like to use instead of the usual one, you could assign  FONTS: to
    that directory by entering
                          > Assign fonts: df1:fonts
    Now when you open NotePad you'll find those alternative fonts in the
    fonts menu. This can be done for any program which can handle more
    than just the system font, which you're reading now.
      _ Likewise, you might have a few commands in the  C  directory of
    your other disc which you want to use and which aren't on your current
    System disc (the one you booted up with). So to use that  C  directory
    enter                 > assign c: df1:c
    And so on. Experiment, you can't damage anything.



                     MULTI-TASKING AND THE 'RUN' COMMAND
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      One of the most useful and powerful features of the Amiga is that,
    unlike all its PC competition, it can multi-task, meaning that it can
    be doing a few things at once, subject to memory limitations. This puts
    it in the exalted company of much more expensive work-stations which
    have been doing it for a while. The top of the range of the new IBMs
    can supposedly do it now, too, but you're paying for it - and I believe
    the new MACII will not be able to do so.
      What this means is that with well-designed programs you can have a
    number of them going at once in their own windows, and are able to
    switch back and forth. You can also be printing out some hardcopy while
    beavering away at your next letter. Or you can have a graphic display
    going while you are doing something else. So if you're doing something
    and find that you've forgotten a name which is located somewhere deep
    in another directory you can switch over to it and check and return.
      In the CLI, the RUN command lets you execute a task separately in
    another CLI window or invisibly. So if you want to print the file
    MYLETTER while you continue to tidy up your files or whatever, enter
                     > run type myletter to prt:           rather than
                     > type myletter to prt:
    which takes over your current CLI window until it's finished.
      What's more, RUN lets you execute a series of tasks one after the
    other with the simple inclusion of a    +   sign. For example
                     > run info > prt: +
                     > type df1:articles/thisarticle to prt: +
                     > date > prt: +
                     > delete df1:articles/thisarticle +
                     > echo "This printout finished, oh Master!"
    This will print out your article with date and the results of the
    INFO command and then give you a message after it has deleted the
    file. So don't neglect the RUN command, it'll save you a bit of time,
    and you might as well use the facilities of the flash machine you've
    bought.


