home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
- ARP User's Manual October 7, 1987
-
-
-
-
-
- Wherein we present some of the truly outstanding features
- of the new ARP programs, attempting to point the way for
- new users of ARP to take immediate advantage of the ARP
- software.
-
-
- 1. _G_e_n_e_r_a_l__F_e_a_t_u_r_e_s__o_f__A_R_P__P_r_o_g_r_a_m_s
-
- Since one of the goals of ARP is to make the Amiga
- easier for you to use, we tried as hard as we could to
- make it possible for you to install ARP, and continue to
- use previously written batch files without any change at
- all. Additionally, you should be able to use the ARP
- programs immediately, without learning anything more about
- them, since the degree of compatibility is very high.
- However, ARP programs are generally enhanced and improved,
- and generally much easier to use. To take advantage of
- these new features, you have to learn about them, so read
- on!
-
- 1.1 _C_o_n_s_i_s_t_a_n_c_y__o_f__t_h_e__A_R_P__p_r_o_g_r_a_m_s
-
- One of the problems with the original AmigaDOS
- programs was that they are too inconsistant. Some
- programs accepted 10 or 20 filenames, and also allowed you
- to use wildcards to specify files. Some programs accepted
- multiple files, but didn't allow wild cards. And some
- programs accepted only one filename. We have tried to fix
- this in ARP. Where it is reasonable to expect to be able
- to supply multiple arguments to a program, we have
- provided that capability. Where it is reasonable to
- expect to be able to use wildcards, we have provided that
- capability also. We have attempted to make the command
- templates for programs more consistant as well, allowing
- abbreviations for commonly used switches and options.
-
- This consistant command interface provides a lot of
- power. As a simple example, consider the problem of
- dumping a lot of files to your printer for a quick
- reference. Let's say you want to send all the files in
- the current directory which end in ".c" to the printer.
- Due to the ARP command structure, there are no less than
- three ways to do this, and all of them use remarkably
-
-
-
-
-
-
-
-
-
-
-
- - 2 -
-
-
-
- similar command lines:
-
-
- 1> Type #?.c to PRT:
- 1> Copy #?.c to PRT:
- 1> Join #?.c to PRT:
-
-
- Incidentally, we also supply a more standard set of
- wildcards, in addition to the ones in use on the Amiga, so
- you could also do
-
-
- 1> Type *.c to PRT:
- 1> Copy *.c to PRT:
- 1> Join *.c to PRT:
-
-
- If you were to try the same thing using the AmigaDOS
- programs, you would be in for a rude shock. First, let's
- try type:
-
-
- 1> Type #?.c to PRT:
- Can't open #?.c
-
-
- It appears that the AmigaDOS type doesn't understand
- wildcards. Well, let's try Copy:
-
-
- 1> Copy #?.c to PRT:
- Destination must be a directory
-
-
- Cute, Copy lets you use wildcards, but then you can't copy
- anything to the printer. It turns out that the only way
- to send all your files to the printer is to specify each
- one in full. And if you wanted to use the special
- capabilities of Type, for example, to add line numbers to
- the files as you print them out, you are reduced to
- multiple Type commands, since the AmigaDOS type only
- accepts one argument. Using the ARP Type, you can supply
- multiple arguments, and each argument can contain
- wildcards.
-
- The main point to notice here is how ARP provides you
- with a consistant command environment. Because the ARP
- programs don't impose artificial limitations, each command
- is more powerful and more useful. And because ARP
- programs strive to be consistant with each other, you
-
-
-
-
-
-
-
-
-
-
-
- - 3 -
-
-
-
- don't have to remember silly special cases, and can apply
- what you have learned about one program to a new one. For
- example, having noticed that Copy, Join and Type all allow
- wildcards, you can probably assume that a command like
- Rename does as well, and you would be correct. As another
- example of the increased power of ARP, let's say you
- wanted to move the three files memo1, memo2 and memo3 to a
- directory on the same disk called OLD_MEMOS. Using
- AmigaDOS, you would have to do it this way:
-
-
- 1> Rename memo1 OLD_MEMOS
- 1> Rename memo2 OLD_MEMOS
- 1> Rename memo3 OLD_MEMOS
-
-
- This kind of thing can get old pretty quickly. Using the
- ARP Rename, you would simply do
-
-
- 1> Rename memo? OLD_MEMOS
-
-
- The '?' is of course a wildcard that matches any single
- character.
-
-
- 2. _C_o_m_m_a_n_d_s__a_n_d__T_e_m_p_l_a_t_e_s
-
- When we spoke to Amiga users, one of the things they
- liked about the current Amiga programs were the use of
- command templates to specify the arguments to a program.
- Since people liked this, and it seemed like a good idea,
- we kept it in ARP. We extended and modified individual
- templates for commands, and we also have an extended help
- feature. Under AmigaDOS, if you supply a question mark (?)
- as the first argument to a command, it presents you with
- its command template, and waits for you to hand it some
- arguments. The same thing is true of ARP programs, but if
- you need even more information, just type another question
- mark when you get the template, like this:
-
-
- 1> Type ?
- FROMA,,,,,,,,,,TOK,OPTK: ?
- Type [upto 10 files] To outfile OPT <H(ex) N(umbers)>
- FROMA,,,,,,,,,,TOK,OPTK:
-
-
- The first thing Type gives you when you supply a question
- mark is its command template. If that is not enough
-
-
-
-
-
-
-
-
-
-
-
- - 4 -
-
-
-
- information for you (for example, if you forget what
- options you can pass to type), typing another question
- mark after you get the template causes an additional help
- message to be displayed, and then the template is
- reprinted, and the command waits again for you to supply
- it with some arguments. This allows you to get extra help
- for commands you don't use often, and not be bothered by a
- lot of information for commands that you do use a lot.
-
- Another thing ARP tries hard to do is to give
- informative error messages. For example, when you type
- the following under AmigaDOS:
-
-
- 1> Echo "Hello World!
- Bad Args to Echo
-
-
- You get a not too helpful message. The same action using
- the ARP echo would cause:
-
-
- 1> Echo "Hello World!
- Bad Args: Unmatched quotes
-
-
- ARP attempts to help you identify the problem, so you can
- fix it more rapidly. As under AmigaDOS, you can supply
- arguments to ARP programs using either keywords, or using*
- positions:
-
-
- 1> Type infile
- 1> Type FROM infile
- 1> Type FROM infile TO outfile
- 1> Type OPT h TO outfile FROM infile
-
-
- All of the above will work. In addition, if you make an
- error:
-
-
-
-
-
-
- __________
-
- * The template keywords are given in upper case only for
- clarity - you can use any case you like.
-
-
-
-
-
-
-
-
-
-
-
-
- - 5 -
-
-
-
-
- 1> Type FROM
- Bad Args: Keyword needs an argument
- or
- 1> Type infile From outfile
- Bad Args: Bad positional argument
-
-
- the ARP programs once again attempt to help you diagnose
- the problem. In the first example, you specified a file by
- keyword (the FROM), but left off the filename. (If you
- really wanted to type a file by the name of FROM, you need
- to use double quotes, for example, Type "FROM". ARP
- programs, like AmigaDOS programs, assume that names inside
- of quotes are filenames and not template keywords.) In
- the second case, you gave the first argument twice, once
- by position, and then by keyword. Type doesn't know what
- you mean, since you appeared to have misused a positional
- argument.
-
-
- 3. _E_s_c_a_p_e_s
-
- One source of incompatibility between ARP programs (note)
- and the AmigaDOS programs they are intended to replace is
- that AmigaDOS programs regard an asterisk inside of quotes
- as an 'escape' character, one that has a special meaning.
- Because so many people wanted support for the asterisk as
- a wildcard something had to go, since the usages would
- conflict - any given program wouldn't be able to tell
- whether you meant to use the asterisk as a wildcard or as
- an escape character. Since, in addition, the use of the
- "*" as an escape character was an undocumented feature of
- AmigaDOS, we decided it was worthwhile to sacrifice
- compatibility on that score. So if you are one of those
- people that discovered the "*" usage of AmigaDOS, you
- won't be able to use batch files with that kind of
- character in it without some editing.
-
- ARP supports escapes, in fact, ARP escapes are much
- more flexible than AmigaDOS escapes, which the ARP escapes
- include as a subset. The ARP escape character* is a
- backslash (\), so the only editing you should have to
-
-
- __________
-
- * Actually, you can select your own escape character if
- it matters that much to you, see the ARP Programmers
- Manual for more information.
-
-
-
-
- NOTE - We reverted to using BCPL-compatible * as the
- escape char in V1.0 of arp.library; if you prefer to
- use \, there will be a setup program for V1.1
-
-
-
-
-
- - 6 -
-
-
-
- perform on your batch scripts which use AmigaDOS escapes
- is to replace the asterisks (*) with backslashes (\).
-
- ARP recognizes the following characters as special
- 'escape' characters:
-
-
- \N Newline
- \T Horizontal Tab
- \V Vertical Tab
- \B Backspace
- \R Return
- \F Formfeed
- \E Escape (ascii 27)
- \Xnn Hex number nn
-
-
- ARP programs (like AmigaDOS) programs, will only recognize
- the escape character inside of double quotes*, so if you
- want to use escapes, you must also use the double quotes.
- To include a single backslash inside of quotes, you need
- to use two of them, like this "\\". You can also include
- double quotes inside of double quotes, by escaping them as
- well, for example, "\"Inside Quotes\"". As usual, of
- course, the special escape characters can be either upper
- or lower case. If you use hex digits, there can be one or
- two of them, and they can also be either upper or lower
- case. Escapes can be very convenient to use, for example,
- to advance your printer paper to the next sheet, you can
- do:
-
-
- 1> Echo >PRT: "\F"
-
-
- Which sends a formfeed to the printer. You should
- generally be careful about using escapes in filenames,
- since this can lead to confusion. One place escape
- characters might be appropriate is in Filenotes, for
- example:
-
-
-
-
-
- __________
-
- * An exception to this is Echo, which always escapes its
- arguments. This is inconsistant, perhaps, but it
- turns out to be very convenient.
-
-
-
-
-
-
-
-
-
-
-
-
- - 7 -
-
-
-
-
- 1> Filenote "Filename" "\X9B7mReverse Print Comment\X9B0m"
-
-
- Which will cause the filenote to List in reverse print
- when you display it, making it stand out more clearly.
-
-
- 4. _A_R_P__a_n_d__W_i_l_d_c_a_r_d_s
-
- ARP has an extensive set of wildcards, and most ARP
- programs allow them to be used. ARP supports ALL of the
- AmigaDOS set of wildcards, as well as the more standard
- Unix* style of wildcards. ARP supports the following
- wildcard characters, note that these are valid inside or
- out of quotes:
-
-
- (a|b|c) Will match one of a, b or c.
- These can be patterns.
-
- ? Matches any single character
- #<pat> Pattern repeated 0 or more times,
- in particular, #? matches anything.
-
- [char] A set of characters, for example,
- [abc] or [a..c] specify the same set.
-
- [^char] Match everything but this set of characters.
- * 0 or more occurances of any character.
-
-
- These can be used in combination, of course, so that
- *.(c|h) or *.[ch] will match any filenames ending in
- either .c or .h preceeded by any number of characters,
- including no characters.
-
- In addition, ARP allows wildcards to be used at
- multiple levels of a directory hierarchy. For example, if
- you want to type all the files in all the directories of
- your INCLUDE directory, you could use
-
-
-
-
-
-
- __________
-
- * Unix is a trade mark of AT&T.
-
-
-
-
-
-
-
-
-
-
-
-
- - 8 -
-
-
-
-
- 1> Type DF0:Include/*/*
-
-
- Which will take care of things nicely. You can be more
- selective, for example only typing files that start with T
- in directories that start with E:
-
-
- 1> Type DF0:Include/E*/T*
-
-
- But the best way to get used to the increased power of the
- ARP wildcard system is to sit down and enjoy using it.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-