COPYRIGHT NOTICE: cat 37.1 (29.6.96) is Copyright (c) 1996 by Ralph Seichter, all rights reserved. You are allowed to copy it freely and use it as you wish, as long as you don't modify the distribution archive or its contents. Note that you *MUST NOT* take money for giving away copies to other users! Ralph Seichter e-mail: zodiac@darkness.gun.de Am Christenrain 12 56479 Stein Germany Feel free to contact me if you have any suggestions or bug reports. Please use e-mail if possible. PURPOSE: Some of you may know 'cat' from UNIX systems, and I decided to write an AmigaOS version which is smaller than 'GNUcat' (2680 bytes) and supports all dos.library wildcards. 'cat' is pure and can be made resident by adding the line Resident cat PURE ADD to your user-startup or startup-sequence. The template for 'cat' is FILE/M/A,BUFFERS/N. BUFFERS defines the number of 1 KB buffers used for copying (default = 64), while FILE allows passing multiple file names or name patterns (including wildcards). Imagine a huge file 'foo' which has been split into pieces on a UNIX platform, resulting in the output files foo.aa, foo.ab, foo.ac, [...], foo.zx, foo.zy, foo.zz. To retrieve the original file, you could use the 'Join' command in your C: directory 1> join foo.aa foo.ab ... foo.zy foo.zz as foo Unfortunately you would have to enter each of the 676 file names manually. If that's not your idea of fun, simply use 1> cat foo.?? > foo instead, and you're done. By the way, if you ask yourself why this tool is called 'cat': the name does not stand for a feline, but as an abbreviation for 'concatenate'. OPERATION: 'cat' processes each of the given file names (or patterns) in sequential order. File names matching the current pattern are sorted alphabetically to guarantee proper ordering, and then the files' contents are written to the standard output channel. Then, the next pattern is processed. You will usually want to redirect the output into a file or a pipe. Here are some usage examples: 1> cat foo bar > foobar Join foo and bar as foobar. 1> cat #?.doc DH2:dir2/#?.doc > DH1:documents Concatenate files with the suffix .doc found in the current directory and after that the files in DH2:dir2/ into the file DH1:documents. 1> cat foo.?? | gzip > foo.gz The files matching foo.?? are piped to GNUzip, the compressed output is written to foo.gz. If you ask "why not use 'Type' instead?", please note that 'Type' does not sort matching file names first, so ordering is unpredictable. REQUIREMENTS: 'cat' requires dos.library V37 (Kickstart 2.04) or better. DISCLAIMER: THIS MATERIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE USE, RESULTS, AND PERFORMANCE OF THIS MATERIAL IS ASSUMED BY YOU AND IF THE PRODUCT SHOULD PROVE TO BE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR, OR OTHER REMEDIATION.