#-h- ar 7038 asc 30-oct-80 09:14:00 tools .bp .rm 70 .in 0 .he 'AR'10/11/79'AR' .fo ''-#-' .fi .in 7 .ti -7 NAME .br ar - archive file maintainer .sp 1 .ti -7 SYNOPSIS .br ar {dpstux}[v/1] arcname [file] ... .sp 1 .ti -7 DESCRIPTION .br Ar collects sets of arbitrary files into one big file and maintains that file as an 'archive'. Files can be extracted from the archive, new ones can be added, old ones can be deleted or replaced by updated versions, and data about the contents can be listed. If a minus sign ('-') is given as a file name, further file names are read from the standard input, one file name per line. Files that are to be added to an archive must exist as files with the name given. Files that are extracted from an archive will be put onto files with the name given. Files that are added to archives can, of course, be archive files themselves. There is no (theoretical) limit to the number of files that can be nested this way. Thus AR provides the utility necessary to maintain tree-structured file directories. AR is invoked by the command line .br .ti +10 AR command archname [optional filenames] where 'command' is any one of 'uxtpds', optionally concatenated with 'v' or '1', specifying what operation to perform on the archive file named 'archname'. The possible commands are: .br .in +10 u - Update named archive by replacing existing files or adding new ones at end. If the 'v' option is used, file names will be printed on the standard output as files are written to the new archived file. x - Extract named files from archive. Put onto file of the same name. If the 'v' option is added, file names will be printed on the standard output as files are extracted. d - Delete named files from archive. If the 'v' option is used, file names will be printed on the standard output as they are deleted from the archive. p - Print named files on standard output. Using the 'v' option will cause the file name to precede the file. t - Print table of archive contents. Normally, the table will contain only the file name. If the 'v' option is used, the table will also contain the file's length, type, and date and time of last change. By default, if the standard output is a terminal, ar will pack five names per line in the non-verbose mode. If the optional '1' option is used, the output is force to single column, which is the default is standard output is not a terminal. For example, ar t archive might generate the following output: a b c d whereas ar t1 archive would generate .nf a b c d .fi s - Salvage. This command may be used to recover a damaged archive whose character counts do not reflect the correct number of characters in the file. The 's' command extracts all files from the archive, ignoring characters counts, date and time stamps, etc. on the archive header lines; it simply uses '#-h-, which begins each archive member, and the file name which follows it. The files are then replaced in the archive, with corrected character counts. Thus, the 's' flag is useful for salvaging the contents of 'alien' archive files and for saving damaged archives. It does not work on nested archives (i.e. archives within archives). v - Verbose. This command may be concatenated to any of the above commands, and will cause the archiver to print additional information, generally file names, on the standard output. Its specific action for each command has already been described. .br .in -10 The optional filenames in the command line specify individual files that may participate in the action. If no files are named, the action is done on ALL files in the archive, but if any files are explicitly named, they are the ONLY ones that take part in the action. (The 'd' command is an exception--files may be deleted only by specifying their names.) .br .sp 1 .ti -7 FILES .br A file 'arctemp' is created and subsequently deleted for each run. .sp 1 .ti -7 SEE ALSO .br The Unix commands 'ar' and 'ls' in the Unix manual .sp 1 .ti -7 DIAGNOSTICS .br archive not in proper format .br .in +10 The basic problem is that archive didn't find a header line where one was expected. Typical reasons include misspelling the file name, using an existing file (not in archive format) on a creation run, and referencing an archive file that has been modified directly (say with the editor). .br .in -10 delete by name only .br .in +10 For user protection, files are allowed to be deleted from an archive only by specifying each file name. .br .in -10 duplicate file name .br .in +10 A file was listed more than once when calling the archiver .br .in -10 fatal errors-archive not altered .br .in +10 This message is generated whenever one or more of the other errors have been detected. An archive is never altered unless EVERYTHING has run properly. .br .in -10 too many file names .br .in +10 At the present the user may call the archiver with no more than 25 files at a time. .br .in -10 usage: ar [dptuxsv] arcname [files] .br .in +10 The command line passed to the archiver is in error. Possibly the command is wrong or the archived file name has not been given. .br .in -10 'filename': can't add .br .in +10 The file specified by 'filename' doesn't exist or can't be opened (e. g. is locked). .br .in -10 'filename': can't create .br .in +10 The archiver could not generate a local file by the name of 'filename'. Probably the archiver's internal file buffer space has been exceeded. .br .in -10 'filename': not in archive .br .in +10 The archiver could not locate the file specified by 'filename' in the archived file. .br .in -10 .sp 1 .ti -7 AUTHORS .br Original code from Kernighan and Plauger's 'Software Tools', with modifications by Debbie Scherrer. .sp 1 .ti -7 BUGS/DEFICIENCIES .br On some systems only text files can be archived. When the update and print commands are used, the files are updated or printed in the order they appear on the archived file, NOT the order listed on the command line. The 's' salvage command works only on unnested archives. The Unix archiver allows files to be positioned in the archive, rather than simply added at the end as AR does. This is done by adding the following commands: .br .in +10 m - Move specified files to end of archive ma posname - Move specified files to position after file 'posname' mb posname - Move specified files to position before file 'posname' r - Replace specified files and place at end of archive ra posname - Replace files and place after file 'posname' rb posname - Replace files and place before file 'posname' .br .in -10 There are some discrepancies between the Unix version of AR and this version. Unix uses 'r'--replace instead of 'u'--update. Unix also requires the user to specify an additional command 'n' when creating a new archive. #-h- cat 983 asc 30-oct-80 09:14:02 tools .bp .rm 70 .in 0 .he 'CAT'02/16/78'CAT' .fo ''-#-' .fi NAME .br .in 7 cat -- concatenate and print text files .sp 1 .in SYNOPSIS .br .in 7 CAT [file1] [file2]... .sp 1 .in DESCRIPTION .br .in 7 Cat reads each file in sequence and writes it on the standard output. Thus .sp 1 .ti +5 CAT file .sp 1 prints the file, and .sp 1 .ti +5 CAT file1 file2 >file3 .sp 1 concatenates the first two files and places the result on the third. .sp 1 If no argument or '-' is given, cat reads the standard input. .sp 1 .in FILES .br .in 7 None .sp 1 .in SEE ALSO .br .in 7 The "Software Tools" book, p. 77. .br The UNIX tools CAT, PR, CP .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if a file cannot be opened; further processing is terminated. .sp 1 .in AUTHORS .br .in 7 .sp 1 Dennis Hall, Debbie Scherrer and Wen-Sue Gee. .sp 1 .in BUGS .br .in 7 Using the same file for output as well as input may cause strange results. #-h- ccnt 738 asc 30-oct-80 09:14:02 tools .bp .rm 70 .in 0 .he 'CCNT'1/11/79'CCNT' .fo ''-#-' .fi NAME .br .in 7 ccnt - character count .sp 1 .in SYNOPSIS .br .in 7 ccnt [file ...] .sp 1 .in DESCRIPTION .br .in 7 Ccnt counts characters in the named file(s). Newlines are counted as characters. If no file name or the file '-' is given, standard input will be read. .sp 1 .in FILES .br .in 7 .sp 1 .in SEE ALSO .br .in 7 wcnt; lcnt; the Unix command 'wc' .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if an input file cannot be opened; further processing is terminated. .sp 1 .in AUTHORS .br .in 7 .sp 1 Original from Kernighan and Plauger's 'Software Tools', with minor modifications by Debbie Scherrer. .sp 1 .in BUGS .br .in 7 #-h- ch 4119 asc 30-oct-80 09:14:03 tools .bp .pl 60 .rm 70 .in 0 .he *CH*04/07/78*CH* .fo **-#-** .in 7 .fi .ti -7 NAME .br ch - make changes in text files .sp 1 .ti -7 SYNOPSIS .br ch [-ax] [expr ...] fromexpr [toexpr] .sp 1 .ti -7 DESCRIPTION .br ch copies each line of the standard input to the standard output, globally substituting the text pattern "toexpr" for "fromexpr" on each line that satisfies matching criteria defined by the leading expressions "expr" and the switches. (A text pattern is a subset of a "regular expression"--see the "ed" writeup for a complete description.) Three possible courses of action are taken depending upon the number of text patterns(n) found in the command line: .sp .in +5 .ti -5 n=1 The text pattern is assumed to be "fromexpr" with a null "toexpr"; it is equivalent to the ed command .ti +10 g/fromexpr/s///g .ti -5 n=2 The first text pattern is "fromexpr", the second is "toexpr"; it is equivalent to the ed command .ti +10 g/fromexpr/s//toexpr/g .ti -5 n>=3 The (n-1)th pattern is "fromexpr", the nth is "toexpr" and patterns 1...n-2 are used to determine the lines upon which to perform the substitution. The default is that any line which matches any one of the n-2 leading expressions are eligible for substitution. If the -a flag is specified, only lines which match all n-2 leading expressions in any order are eligible. If the -x flag is specified, all lines which don't satisfy the above criteria are eligible. (See the writeup on find for more information.) In particular, if n=3, .ti +10 ch expr from to .br is equivalent to the ed command .ti +10 g/expr/s/from/to/g .ti +10 ch -x expr from to .br is equivalent to the ed command .ti +10 x/expr/s/from/to/g .sp .in -5 The substitution string "toexpr" may be a string of replacement characters, null to effect a deletion, or it may include the special "ditto" character "&" to put back the "fromexpr" string and thus effect an insertion. If a deletion is desired with the multiple leading tag expressions, a "toexpr" of "" -i.e. quotes around an empty string may be used. A text pattern consists of the following elements: .nf c literal character ? any character except newline % beginning of line $ end of line (null string before newline) [...] character class (any one of these characters) [!...] negated character class (all but these characters) * closure (zero or more occurrences of previous pattern) + anchored closure (one or more occurrences of previous pattern) @c escaped character (e.g., @%, @[, @*) .fi Any special meaning of characters in a text pattern is lost when escaped, inside [...], or for: .nf % not at beginning $ not at end * at beginning + at beginning .fi A character class consists of zero or more of the following elements, surrounded by [ and ]: .nf c literal character a-b range of characters (digits, lower or upper case) ! negated character class if at beginning @c escaped character (@! @- @@ @]) .fi Special meaning of characters in a character class is lost when escaped or for .nf ! not at beginning - at beginning or end .fi An escape sequence consists of the character @ followed by a single character: .nf @n newline @t tab @c c (including @@) .fi For a complete description, see "Software Tools" pages 135-154. Care should be taken when using the characters % $ [ ] ! * + @ and any shell characters in the text pattern. It is often necessary to enclose the entire substitution pattern in quotes. .sp 1 .ti -7 FILES .br None .sp 1 .ti -7 SEE ALSO .br The UNIX tool GRES .br The tools find and ed .sp 1 .ti -7 DIAGNOSTICS .br An error message is printed if the pattern given is illegal. .sp 1 .ti -7 AUTHORS .br 'CH' was originally implemented on BKY by Debbie Scherrer from Kernighan and Plauger's "Software Tools". Major modifications were performed by Joe Sventek. .sp 1 .ti -7 BUGS/DEFICIENCIES .br A minus sign(dash[-]) may not start an expression. #-h- cmp 1010 asc 30-oct-80 09:14:04 tools .bp .rm 70 .in 0 .he 'CMP'03/06/78'CMP .fo ''-#- .fi .in 7 .ti -7 NAME .br cmp - compare two files .sp 1 .ti -7 SYNOPSIS .br cmp file1 file2 .sp 1 .ti -7 DESCRIPTION .br File1 is compared line-by-line with file2. If any lines differ, cmp announces the line number and prints each file's offending line. .sp 1 .ti -7 FILES .br None .sp 1 .ti -7 SEE ALSO .br comm .br The UNIX commands cmp, diff, and comm .sp 1 .ti -7 DIAGNOSTICS .br If the end of one file is reached before the end of the other, a message is printed. .sp 1 .ti -7 AUTHORS .br Acquired from "Software Tools" by Kernighan and Plauger, with minor modifications made by Debbie Scherrer. .sp 1 .ti -7 BUGS .br .sp 1 If either file is binary, spurious results should be expected. .sp Cmp cannot handle offset lines: line n of file1 is simply compared to line n of file2. Trailing blanks are significant, which will cause some lines to appear similar to the user which are actually different. #-h- comm 1250 asc 30-oct-80 09:14:04 tools .bp .rm 70 .in 0 .he 'COMM'1/11/79'COMM' .fo ''-#-' .fi NAME .br .in 7 comm - print lines common to two files .sp 1 .in SYNOPSIS .br .in 7 comm [-123] file1 file2 .sp 1 .in DESCRIPTION .br .in 7 Comm reads file1 and file2, which should be sorted, and produces a three column output: lines only in file1, lines only in file2, and lines in both files. The filename '-' means the standard input. If there is only one file argument, file2 refers to the standard input. The optional arguments -1, -2, and -3 specify the printing of only the corresponding column. Thus comm -3 prints only the lines common to both files, and comm -12 prints lines which are in either file, but not in both. The default is -123. .sp 1 .in FILES .br .in 7 None .sp 1 .in SEE ALSO .br .in 7 The tool 'cmp'; the Unix tool 'diff'. .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if an input file cannot be opened. .sp 1 .in AUTHORS .br .in 7 .sp 1 Debbie Scherrer .sp 1 .in BUGS .br .in 7 The flags used by this tool are the reverse of those used by the Unix 'comm'. In Unix, the flags 1, 2, and 3 suppress printing of the corresponding column. Kernighan, on page 126 of 'Software Tools' suggests the version used above. #-h- cpress 786 asc 30-oct-80 09:14:05 tools .bp .rm 70 .in 0 .he 'CPRESS'1/15/79'CPRESS' .fo ''-#-' .fi NAME .br .in 7 cpress - compress input files .sp 1 .in SYNOPSIS .br .in 7 cpress [file ...] .sp 1 .in DESCRIPTION .br .in 7 Cpress compresses runs of repeated characters in the input files. The output file can eventually be expanded with the tool 'expand'. If no input files are given, or the filename '-' appears, input will be from the standard input. .sp 1 .in FILES .br .in 7 .sp 1 .in SEE ALSO .br .in 7 expand .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if an input file cannot be opened; further processing is terminated. .sp 1 .in AUTHORS .br .in 7 .sp 1 From Kernighan & Plauger's 'Software Tools', with modifications by Debbie Scherrer. .sp 1 .in BUGS .br .in 7 #-h- crt 1145 asc 30-oct-80 09:14:05 tools .bp .rm 70 .in 0 .he 'CRT'1/12/79'CRT' .fo ''-#-' .fi NAME .br .in 7 crt - copy files to terminal .sp 1 .in SYNOPSIS .br .in 7 crt [-n] [file ...] .sp 1 .in DESCRIPTION .br .in 7 CRT is similar to 'cat' except that it prints only n lines (default 22) at a time. After each set of lines are printed, crt will wait for instructions from the user. Hitting a carriage-return will cause the next n lines to appear, hitting a 'q' (quit) will cause crt to skip over to the next input file (if any), and hitting an end-of-file character will cause crt to stop immediately. If no files are specified, or if the filename '-' is given, lines will be read from the standard input. The flag -n may be given, where n specifies the number of lines desired at a time. Crt will stop at the end of each file (except the last), as well as after each n lines. .sp 1 .in FILES .br .in 7 .sp 1 .in SEE ALSO .br .in 7 cat .sp 1 .in DIAGNOSTICS .br .in 7 A message is printed if an input file cannot be opened; further processing is terminated. .sp 1 .in AUTHORS .br .in 7 .sp 1 Debbie Scherrer .sp 1 .in BUGS .br .in 7 #-h- crypt 1131 asc 30-oct-80 09:14:06 tools .bp .rm 70 .in 0 .he 'CRYPT'1/15/79'CRYPT' .fo ''-#-' .fi NAME .br .in 7 crypt - crypt and decrypt standard input .sp 1 .in SYNOPSIS .br .in 7 crypt key .sp 1 .in DESCRIPTION .br .in 7 Crypt encrypts characters on the standard input by using 'key'. The file can eventually be decrypted by running it back through crypt with the same key. Double encryption (encrypting a file with first one key and then another) is allowable, but on some systems the decryption must be done in the exact reverse order as encryption was done. The encryption algorithm used by 'crypt' is not a complicated one, so users requiring a great degree of protection should not rely on this tool. .sp 1 .in FILES .br .in 7 .sp 1 .in SEE ALSO .br .in 7 .sp 1 .in DIAGNOSTICS .br .in 7 .sp 1 .in AUTHORS .br .in 7 .sp 1 Original from Kernighan & Plauger's 'Software Tools', with modifications by Debbie Scherrer. (NOTE: the original encryption algorithm has been altered slightly.) .sp 1 .in BUGS .br .in 7 On IAS and VMS systems, double encryption must be decrypted in the exact reverse order as the encryption. #-h- date 476 asc 30-oct-80 09:14:07 tools .bp .rm 70 .in 0 .he 'DATE'1/11/79'DATE' .fo ''-#-' .fi NAME .br .in 7 date - print the date .sp 1 .in SYNOPSIS .br .in 7 date .sp 1 .in DESCRIPTION .br .in 7 The current date and time are printed in the format: .ce dd-mmm-yy hh:mm:ss .sp 1 .in FILES .br .in 7 None .sp 1 .in SEE ALSO .br .in 7 The Unix command 'date' .sp 1 .in DIAGNOSTICS .br .in 7 None .sp 1 .in AUTHORS .br .in 7 .sp 1 Debbie Scherrer .sp 1 .in BUGS .br .in 7 #-h- detab 862 asc 30-oct-80 09:14:07 tools .bp .rm 70 .in 0 .he 'DETAB'date'DETAB' .fo ''-#-' .fi NAME .br .in 7 detab - convert tabs to spaces .sp 1 .in SYNOPSIS .br .in 7 detab [...] [+] [file...] .sp 1 .in DESCRIPTION .br .in 7 Detab converts tab characters (control-i) to equivalent strings of blanks. Tab stops are indicated by ... (default 8, 16, ...), while + indicates tab stops every columns. Thus the command .ti +3 detab 5 21 +5 supplies blanks for tabs terminating at column positions 5, 21, 26, etc. If no files are specified, the standard input is read. An isolated minus sign also indicates the standard input. .sp 1 .in SEE ALSO .br .in 7 entab; lpr .sp 1 .in AUTHORS .br .in 7 .sp 1 Original from Kernighan & Plauger's 'Software Tools', with modifications by Dennis Hall and Debbie Scherrer. .sp 1 .in BUGS .br .in 7 None to date. #-h- echo 594 asc 30-oct-80 09:14:07 tools .pl 60 .bp .in 0 .rm 70 .he 'ECHO'07/07/78'ECHO' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br echo - echo command line arguments .sp 1 .ti -7 SYNOPSIS .br echo [arg ...] .sp 1 .ti -7 DESCRIPTION .br Echo writes its arguments in order as a line on the standard output file. It is useful for producing messages and diagnostics in command files. .sp 1 .ti -7 FILES .br None .sp 1 .ti -7 SEE ALSO .br The Unix command 'echo' in the Unix manual .sp 1 .ti -7 DIAGNOSTICS .br None .sp 1 .ti -7 AUTHORS .br Debbie Scherrer .sp 1 .ti -7 BUGS/DEFICIENCIES .br #-h- ed 15424 asc 30-oct-80 09:14:09 tools .bp .pl 60 .rm 70 .in 0 .he *ED*04/21/78*ED .fo ''-#-'' .fi .in 7 .ti -7 NAME .br ed - text editor .sp 1 .ti -7 SYNOPSIS .br ed [-] [-pstring] [file] .sp 1 .ti -7 DESCRIPTION .br Ed is a text editor. If the 'file' argument is given, the file is read into ed's buffer so that it can be edited and its name is remembered for possible future use. Ed operates on a copy of any file it is editing; changes made in the copy have no effect on the file until a w (write) command is given. The optional '-' suppresses the printing of line counts by the e (edit), r (read), and w (write) commands. The -p flag may be used to specify ed's prompt string. The default is ": ". If prompting is not desired, a bare -p in the command line will turn it off. Ed accepts commands from script files as well as a terminal. To do this, invoke ed and substitute the script file name for the standard input, as follows - ed [file]