#-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 [<t1>...] [+<n>] [file...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Detab converts tab characters (control-i) to equivalent strings
of blanks.
Tab stops are indicated by <t1>...
(default 8, 16, ...),
while +<n> indicates tab stops
every <n> 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] <script 

Commands to ed have a simple and regular structure: zero , one, or two 
line addresses followed by a single character command, possibly 
followed by parameters to the command.  The structure is: 

               [line],[line]command <parameters> 

The '[line]' specifies a line number or address in the buffer. 
Every command which requires addresses has default addresses, 
so the addresses can often be omitted. 

Line addresses may be formed from the following components: 

.nf 

           17           an integer number 
           .            the current line 
           $            the last line in the buffer 
           .+n          "n" lines past the current line 
           .-n          "n" lines before the current line 
           /<pattern>/  a forward context search 
           \<pattern>\  a backward context search 

.fi 
Line numbers may be separated by commas or semicolons; 
a semicolon sets the current line to the previous address 
before the next address is interpreted.  This feature can 
be used to determine the starting line for forward and 
backward context searches ("/" and "\"). 


.ce 
REGULAR EXPRESSIONS 

Ed includes some additional capabilities such as the ability to 
search for patterns that match classes of characters, that match 
patterns only at particular positions on a line, or that match 
text of indefinite length. 
These pattern-seaching capabilities include a class of patterns called 
.bo 
regular expressions. 
Regular expressions are used in addresses to specify lines and in the 
.bo 
s 
command to specify a portion of a line which is to be replaced. 
To be able to express these more general patterns, some special 
characters (called metacharacters) are used. 
The regular expressions allowed by ed are constructed as follows: 

1.  An ordinary character (not one of those discussed below) is a 
regular expression and matches that character. 

2.  A percent "%" at the beginning of a regular expression matches 
the empty string at the beginning of a line. 

3.  A dollar sign "$" at the end of a regular expression matches 
the null character at the end of a line. 

4.  A question mark "?" matches any character except a newline 
character. 

5.  A regular expression followed by an asterisk "*" matches any 
number of adjacent occurrences (including zero) of the regular 
expression it follows. 

6.  A regular expression followed by a plus "+" matches one or more 
adjacent occurrences of the regular 
expression it follows (anchored closure). 

7.  A string of characters enclosed in square brackets "[ ]" matches 
any character in the string but no others.  If, however, the first 
character of the string is an exclamation point "!" the regular 
expression matches any character 
.bo 
except 
the characters in the string (and the newline). 

8.  The concatenation of regular expressions is a regular expression 
which matches the concatenation of the strings matched by the components 
of the regular expression. 

9.  The null regular expression standing alone is equivalent to the 
last regular expression encountered. 

If it is desired to use one of the regular expression metacharacters 
as an ordinary character, that character may be escaped 
by preceding it with an
atsign "@". 
.sp 5
.ce 
COMMANDS 

Following is a list of ed commands.  Default addresses are shown 
in parentheses: 

(.)a 
.br 
<text> 
.br 
       . 
.br 
.in +5 
The append command reads the given text and appends it after the addressed 
line. 
'.' is left on the last line input, if there were any, otherwise at 
the addressed line. 
.br 
.in -5 

(.)b[+/./-][<screensize>]
.br
.in +5
The browse command is a shorthand command to print out a screenful
of data.  It has three basic forms, any of which may have a
number("screensize") appended to it.  The default screensize is 23.  The
b- form will print the screen of text preceding (and including) the
addressed line; b. prints the screen centered on the addressed line;
and b or b+ prints the current line and the screen after it.  "." is
left at the last line printed.  If a screensize is specified, it
becomes the default screensize for the rest of the editing session or
until changed again.
.br
.in -5

(.,.)c 
.br 
<text> 
.br 
       . 
.br 
.in +5 
The change command deletes the addressed lines, then accepts input text 
which replaces these lines.  '.' is left at the last line input, if 
there were any, otherwise at the first line not deleted. 
.br 
.in -5 

(.,.)d 
.br 
.in +5 
The delete command deletes the addressed lines from the buffer. 
The line originally AFTER the last line deleted becomes the current line; 
however, if the lines deleted were originally at the end, the new last line 
becomes the current line. 
.br 
.in -5 

e filename 
.br 
.in +5 
The edit command causes the entire contents of the buffer to be deleted 
and then the named file to be read in. 
'.' is set to the last line of the buffer. 
The number of lines read is typed. 
'Filename' is remembered for possible use as a default file name in 
a subsequent 
.bo 
r 
or 
.bo 
w 
command. 
If changes have been made to the current file since the last
write command, the user will be asked to repeat the edit command.

.in -5 
f filename 
.br 
.in +5 
The filename command prints the currently remembered file name. 
If 'filename' is given, the currently remembered file name is 
changed to 'filename'. 
.br 
.in -5 

(1,$)g/regular expression/command 
.br 
.in +5 
In the global command, the given command is executed for every 
line which matches the given regular expression. 
Multiple commands may be executed by placing each on a preceding
line and terminated each command except the last with an
atsign '@'.
.br 
.in -5 

(.)i 
.br 
<text> 
.br 
       . 
.br 
.in +5 
The insert command inserts the given text BEFORE the addressed line. 
'.' is left at the last line input, or if there were none, at the 
addressed line. 
This command differs from the 
.bo 
a 
command only in the placement of text. 
.br
.in -5

(.,.+1)j
.br
.in +5
The join command joins the specified lines into one line.
'.' is left at the new line created by the join.
If the join would result in a line longer than MAXLINE characters,
an error is reported and no changes are made to the file.
A trailing p or l may be given on the join command to cause
the merged line to be printed or listed.
.br 
.in -5 

(.,.)l 
.br 
.in +5 
The list command prints the addressed lines, expanding all ASCII
characters with values between 1 and 31 (^A - ^_) as the appropriate
two character digraph, ^(character).
'.' is left at the 
last line listed. 
The 
.bo 
l
command may be placed on the same line after any other command 
to cause listing of the last line affected by the command. 
.br 
.in -5 

(.,.)m<address> 
.br 
.in +5 
The move command repositions the addressed lines after the line 
specified by 
.bo 
<address>. 
The last of the moved lines becomes the current line. 
.br 
.in -5 

(.,.)p 
.br 
.in +5 
The print command prints the addressed lines.  '.' is left at the 
last line printed. 
The 
.bo 
p 
command may be placed on the same line after any other command 
to cause printing of the last line affected by the command. 
.br 
.in -5 

q 
.br 
.in +5 
The quit command causes ed to exit. 
No automatic write of the file is done. 
If changes have been made to the current file since the last write
command, the user will be asked to repeat the quit command.
.br 
.in -5 

(.)r filename 
.br 
.in +5 
The read command reads in the given file after the addressed line. 
If no file name is given, the remembered file name is used (see 
.bo 
e 
and 
.bo 
f 
commands). 
The remembered file name is not changed. 
Address '0' is legal for this command and causes the file to be 
read in at the beginning of the buffer. 
If the read is successful, the number of lines read is typed. 
'.' is left at the last line read in from the file. 
.br 
.in -5 

(.,.)s/regular expression/replacement/       or, 
.br 
(.,.)s/regular expression/replacement/g 
.br 
.in +5 
The substitute command searches each addressed line for an occurrence 
of the specified regular expression. 
On each line in which a match is found, the first occurrence of the 
expression is replaced by the replacement specified. 
If the global replacement indicator 
.bo 
g 
appears after the command, all occurrences of the regular 
expression are replaced. 
Any character other than space or newline may be used instead of 
the slash '/' to delimit the regular expression and replacement. 
A question mark '?' is printed if the substitution fails on all 
addressed lines. 
'.' is left at the last line substituted. 

An ampersand '&' appearing in the replacement is replaced by 
the string matching the regular expression. 
(The special meaning of '&' in this context may be suppressed by 
preceding it by '@'.) 

Lines may be split or merged by using the symbol '@n' to stand 
for the newline character at the end of a line. 
.br 
.in -5 


(1,$)w filename 
.br 
.in +5 
The write command writes the addressed lines onto the given file. 
If the file does not exist, it is created. 
The remembered file name is 
.bo 
not 
changed. 
If no file name is given, the remembered file name is used (see 
the 
.bo 
e 
and 
.bo 
f 
commands). 
'.' is left unchanged. 
If the command is successful, the number of lines written is typed. 
.br 
.in -5 

(1,$)x/regular expression/command 
.br 
.in +5 
The except command is the same as the global command except that the 
command is executed for every line 
.bo 
except 
those matching the regular expression. 

.in -5 
(.)= 
.br 
.in +5 
The line number of the addressed line is typed. 
'.' is left unchanged. 
.br 
.in -5 

# comment
.br
.in +5
The remainder of the line after the "#" is a comment and ignored by
the editor.  This allows ed scripts to be commented for future
enlightenment.
.br
.in -5

@shell command
.br
.in +5
The remainder of the line after the "@" is sent to the shell as a
command.  If there is nothing else on the line but a bare "@", the
shell will be spawned, allowing a number of commands to be
performed; when that shell quits, the terminal is returned to the
editor.  "." is left unchanged.
.br
.in -5

(.+1)<carriage return> 
.br 
.in +5 
An address alone on a line causes the addressed line to be printed. 
A blank line alone is equivalent to '.+1' and thus is useful 
for stepping through text. 
A minus '-' followed by a carriage return is equivalent to '.-1'.
.br 
.in -5 
.sp 2 
.ce 
SUMMARY OF SPECIAL CHARACTERS 

.fi 
The following are special characters used by the editor: 

 Character       Usage 
 ---------       ----- 

    ?            Matches any character (except newline) 

    %            Indicates beginning of line 

    $            Indicates end of line or end of file 

    [...]        Character class (any one of these characters) 

    [!...]       Negated character class (any character except these 
                 characters) 

    *            Closure (zero or more occurrences of previous pattern) 

    +            Anchored closure (one or more occurrences)

    @            Escaped character (e.g. @%, @[, @*) 

    &            Ditto, i.e. whatever was matched 

    c1-c2        Range of characters between c1 and c2 

    @n           Specifies the newline character at the end of a line 

    @t           Specifies a tab character 

.sp 1 
.ti -7 
FILES 
.br 
A temporary file is used to hold
the text being edited. 
Two other temporary files, known as $1 and $2, may be used as parameters
for the r, w, and @ commands.  For example, if the current date and time
are desired at the top of the text buffer, perform the following:

.in +5
: @date >$1
.br
: 0r $1

.in -5
As another example, if the user wishes to make a copy of lines 1,5 after
the last line in the buffer, do the following:

.in +5
: 1,5w $1
.br
: $r $1

.in -5
.sp 1 
.ti -7 
SEE ALSO 
.br 
.nf 
The Unix command "ed" in the Unix manual 
The software tools tutorial "Edit"
"Edit is for Beginners" by David A. Mosher (available from 
             UC Berkeley Computer Science Library) 
"Edit:  A Tutorial" (also available from the 
             UC Berkeley Computer Science Library) 
"A Tutorial Introduction to the ED Text Editor" by B. W. Kernighan 
             (UC Berkeley Computer Science Library) 
Kernighan and Plauger's "Software Tools", pages 163-217 
.fi 
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
The error message "?" is printed whenever an edit command 
fails or is not understood. 
.sp 1 
.ti -7 
AUTHORS 
.br 
Original code by Kernighan and Plauger with modifications 
by Debbie Scherrer, Dennis Hall and Joe Sventek. 
.sp 1 
.ti -7 
BUGS/DEFICIENCIES 
.br 
At the present time the editor is still in a somewhat experimental 
version. 
It has not been overlayed yet, nor have any real attempts been 
made to improve its efficiency. 
For these reasons, the field length needed for execution is high 
and the files being edited are limited to 1000(VMS-5000) lines. 
The line limit applies to all lines read in and subsequently 
changed. 
For instance, a 600 line file with 401 changed lines would exceed 
ed's buffer space. 
This problem can be partly alleviated by writing (w command) and 
re-editing (e command) the file after a lot of lines have 
been changed. 

There are several discrepancies between this editor and Unix's ed. 
These include: 

.in +5 
1.  Unix uses 'v' instead of 'x' for the except command. 

2.  Unix uses '^' instead of '%' for the beginning-of-line character. 

3.  Unix uses '.' instead of '?' to indicate a match of any character. 

4.  Unix uses  '^' instead of '!' to indicate exclusion of a 
character class. 

5.  Unix uses '\' instead of '@' for the escape character. 

6.  Unix uses '?' instead of '\' to delimit a backward search pattern. 

7.  The Unix 'r' command uses the last line of the file, instead 
of the current line, as the default address. 

8.  The Unix editor prints the number of characters, rather than 
lines read or written when dealing with files. 


.in -5 
Because of the nature of the editor's IO, it is usually impossible 
to properly print an altered line whenever its newline character 
has been deleted or a new one inserted. 
Line numbering and counts may also become erratic, 
although the file itself is actually correct. 
This problem can be alleviated by writing (w command) and 
re-editing (e command) the file after tampering with any 
newline characters. 
#-h- entab            917  asc  30-oct-80 09:14:12  tools
.bp 
.rm 70 
.in 0 
.he 'ENTAB'date'ENTAB'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
entab - convert spaces to tabs and spaces
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
entab [<t1> ...] [+<n>] [file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Entab replaces strings of blanks with equivalent tabs (control-i)
and blanks.
It can be used to read files and produce typewriter-like
text, reducing file size.
Tab stops are indicated by <t1> ... (default 8, 16, ...),
while +<n> indicates tab stops every <n> columns.
Thus the command
  
.ti +3
entab 5 21 +5
  
would insert tab stops at columns 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 
detab; lpr
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Original from Kernighan & Plauger's 'Software Tools', with modifications
by Dennis Hall
.sp 1 
.in 
BUGS 
.br 
.in 7 
None to date.
#-h- expand           732  asc  30-oct-80 09:14:12  tools
.bp 
.rm 70 
.in 0 
.he 'EXPAND'1.15.79'EXPAND'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
expand - uncompress input files
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
expand
[file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Expand
expands files previously compressed by 'cpress'.
If no input files are given, or if the filename '-' appears,
input will be read from the standard input.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
cpress
.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 & Plauger's 'Software Tools', with minor
modifications by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- fc              1395  asc  30-oct-80 09:14:13  tools
.in 5
.rm 70
.he /FC/%/FC/
.fo //-#-/
.bp 1
NAME
.in +3

fc
- fortran compiler

.ti -3
SYNOPSIS

fc [-c] [-v] [-o] file ...

.ti -3
DESCRIPTION

fc 
is the fortran compiler callable from the software tools shell.  It accepts
the following types of arguments:

.in +3
.ti -3
1. Files whose names end in '.f' are assumed to be fortran source programs.   
They are compiled, and the object file is left on a file whose name is
that of the source with '.obj' substituted for '.f'.

.ti -3
2. Other arguments (except for the flags listed in 3 below) are assumed to
be either loader flags, or object files, typically created by an earlier
fc
run.  These programs, together with the results of any compilations, are
loaded (in the order given) to produce an executable program.

.ti -3
3. Three flags which affect the actions of the compiler are:

.in +3
.ti -3
-c
suppress the loading phase, as does any compilation error in any routine
.ti -3
-v
verbose option; prints name of file as it is compiled at the terminal
.ti -3
-o
generates a fortran listing for 'file.f' on 'file.l'
.in -3
.in -3

.ti -3
SEE ALSO

rc, the ratfor compiler, which provides a more pleasant programming dialect and
environment
.br
ld, the loader, for descriptions of loader flags and process naming conventions

.ti -3
AUTHOR

Joe Sventek wrote the interface of
fc
to the DEC Fortran 4+ compiler.

.ti -3
BUGS

none to date
#-h- find            3294  asc  30-oct-80 09:14:13  tools
.bp 
.rm 70 
.pl 60 
.in 0 
.he 'FIND'03/03/78'FIND 
.fo ''-#-'' 
.fi 
.in 7 
.ti -7 
NAME 
.br 
find - search a file for text patterns 
.sp 1 
.ti -7 
SYNOPSIS 
.br 
find
[-acx] expr [expr ...]
.sp 1 
.ti -7 
DESCRIPTION 
.br 
find
searches the standard input file for lines matching the text patterns
"expr" (up to 9 patterns may be specified) according to the matching
criterion specified by the switches.  (A text pattern is a subset of a
"regular expression"--see the writeup on "ed" for a complete description
of regular expressions.)  Unless the -c option is specified, each matching
line is copied to the standard output.

By default, any line which matches any one of the expressions is considered
a matching line.  If the -a flag is specified, only lines which match all
expressions in any order are considered to match.  If the -x flag is
specified, all lines which don't satisfy the above criteria are considered
matching lines.  And finally, if the -c option is specified, matching
lines are counted instead of being copied to the standard output, and the
final count is written to the standard output.
  
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, including [ 
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 
tr, ed, ch and the UNIX grep command. 
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
An error message is printed if one of the patterns given is illegal. 
.sp 1 
.ti -7
AUTHORS
.br
Originally from Kernighan & Plauger's "Software Tools", with major
modifications by Joe Sventek.
.sp 1
.ti -7 
BUGS 
.br 
An expression may not start with a minus sign(-).

A very complex escape scheme must be used when not operating 
inside the shell on BKY.  This is because BKY only accepts the CDC character 
set in command arguments (see /*/doc/guide). 
#-h- form            1750  asc  30-oct-80 09:14:14  tools
.bp 
.rm 70 
.in 0 
.he 'FORM'3/1/79'FORM'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
FORM -- produces form letter by prompting user for information
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
form [-c] [+c] [file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 

Form
reads input files and writes them to the standard output.
Any time it encounters some characters surrounded by angle brackets
('<' and '>') it prints the string between the characters as a prompt
to the user.
It then reads from the standard input and replaces
the bracketed string with what was read.
 
Normally only one line of input is accepted from the standard input.  However,
a response can be continued on succeeding lines by terminating
each line to be continued with an atsign ('@').
 
The prompts inside the file may also span line boundaries if so desired
(no atsign is needed in this case).
 
The user's answers to prompts are remembered, so duplicate prompts are
replaced without repeating the prompt to the user.
 
If the standard input is not a terminal, no prompts are issued.
 
The '-c' flag may be used to reset the initial character signalling a
prompt.
The character 'c' then replaces the '<'.
 
The '+c' flag may be used to reset the terminating character of a prompt.
The character 'c' then replaces '>'.
.br
.sp 1
.in
FILES 
.br 
.in 7 
The user's terminal is opened both at READ and at WRITE access.
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The Unix form-letter tool
.br
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
If an input file cannot be opened, a message is printed
and execution is terminated.
 
A message is also printed if either the prompt or the response
is too long for the tool's internal buffer.

.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Debbie Scherrer
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- incl            1490  asc  30-oct-80 09:14:15  tools
.bp 
.pl 60 
.in 0 
.rm 70 
.he (INCL(07/10/78(INCL 
.fo ((-#- 
.fi 
.in 7 
.rm 70 
.ti -7 
NAME 
.br 
incl - expand included files 
.sp 1 
.ti -7 
SYNOPSIS 
.br 
incl [file] ... 
.sp 1 
.ti -7 
DESCRIPTION 
.br 
Include copies the input files to the standard output.  Whenever an input 
line begins with 
  
.ce 
include filename 
  
the entire contents of filename will be copied to the standard output. 
If no input files are specified, the standard input is copied. 
An included file may include further includes. 
Multiple input files are allowed. 
Include is used to bring in much-used routines, common declarations 
or definitions, thus insuring use of the same version by all programs. 
.sp 1 
.ti -7 
FILES 
.br 
none 
.sp 1 
.ti -7 
SEE ALSO 
.br 
Kernighan and Plauger's "Software Tools", pages 74-77. 
.br 
The software tools "ratfor" tutorial
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
includes nested too deeply 
.br 
.in +6 
The depth of included files allowed is dependent upon the maximum
number of open files allowed.  
It is generally MAXFILES - 4.
.br 
.in -6 
filename:  can't open 
.br 
.in +6 
File could not be located or maximum number of opened files was exceeded. 
.sp 1 
.in -6 
.ti -7 
AUTHORS 
.br 
Original code by Kernighan and Plauger in "Software Tools", 
with modifications by Ardith Kenney. 
.sp 1 
.ti -7 
BUGS/DEFICIENCIES 
.br 
The depth of included files allowed is dependent upon the maximum
number of open files allowed by the implementor of the primitives.
#-h- kwic             987  asc  30-oct-80 09:14:16  tools
.bp 
.rm 70 
.in 0 
.he 'KWIC'1/15/79'KWIC'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
kwic - make keyword in context index
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
kwic [file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Kwic
rotates lines from the input files so that each word in the sentence
appears at the beginning of a line, with a special character marking
the original position of the end of the line.
The output from kwic is typically sorted with 'sort' and then
unrotated with 'unrot' to produce a keyword-in-context index.
 
If no input files are given, or if the filename '-' appears, lines
will be read from standard input.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
unrot; sort
.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 modifications
by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- lcnt             855  asc  30-oct-80 09:14:16  tools
.bp 
.rm 70 
.in 0 
.he 'LCNT'1/11/79'LCNT'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
lcnt - line count
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
lcnt 
[file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Lcnt
counts the number of lines of text in the named input files, or the 
standard input if no files are given
or the filename '-' appears.
A line is zero or more characters terminated by a NEWLINE marker.
 
Lcnt
could also be implemented as a shell script file:
 
.ce
tr '!@n' | ccnt
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
ccnt; wcnt; the Unix command 'wc'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if an input file could not be opened;
processing is terminated.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Original from Kernighan and Plauger's 'Software Tools', with modifications
by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- ld              1497  asc  30-oct-80 09:14:17  tools
.in 5
.rm 70
.he /LD/%/LD/
.fo //-#-/
.bp 1
.in +3
.ti -3
NAME

ld
- loader

.ti -3
SYNOPSIS

ld [-l[libname]] [-ptaskname] name ...

.ti -3
DESCRIPTION

ld
links together the named modules in the order given, searches the system
libraries to resolve global references and generates an executable process.

ld
understands two flags:

.in +3
.ti -3
-l
signifies that the filename concatenated to the flag is a library name.  -l
alone stands for the ratfor system library, rlib.  The default extension for
a library file is '.olb'.  A library is searched when its name is
encountered, so the placement of -l is significant.  If the ratfor system
library is not explicitly mentioned, it is searched after all other files
have been linked.  The fortran system library is searched at the very end.

.ti -3
-p
signifies that the file name concatenated to the flag is to be the
process name.  If this option is not specified, the process name is
determined in one of two ways:

.in +3
.ti -3
1. The first non-library file name (eg. roff.o) is found, and the file's
extension is replaced by '.tsk' (roff.tsk).  This is then the resulting
process name.

.ti -3
2. Failing 1 (implying that all files listed in the argument list are
libraries), the process image is placed on the file a.out, overwriting
the previous contents of that file.

.in -3
.in -3
.ti -3
AUTHOR

Joe Sventek wrote the interface of
ld
to the DEC task builder.

.ti -3
BUGS

The creation of the process on a.out is not yet implemented.
#-h- ls              1285  asc  30-oct-80 09:14:17  tools
.in 5
.rm 70
.he /LS/%/LS/
.fo //-#-/
.bp 1
.in +3
.ti -3
NAME

ls
- list contents of directory

.ti -3
SYNOPSIS

ls [-1dnrtv] [pathname] ...

.ti -3
DESCRIPTION

ls
lists information about each file argument.  When no argument is given, the
default directory is listed.  The file arguments
may include any of the legal regular expressions described in the man entry
for the editor, with the added feature that the comparisons will be case
insensitive.
By default, the files are listed
in the order in which they are found in the directory.  There
are six options:

.in +3
.ti -3
-1 force single column output to the terminal.  The default is multi-column
output to the terminal, single to a disk file.
.ti -3
-h print a header at the top of verbose listings
.ti -3
-n sort the directory by name
.ti -3
-v
list in verbose format
.ti -3
-t
sort by time modified (oldest first)
.ti -3
-r
reverse the sense of the sort

.in -3
As an example of usage of ls, the following command will cause all of
the files which contain the string tst anywhere in the file name to be
deleted:

.in +3
% ls tst | args rm
.in -3

.ti -3
FILES

lstemp1, lstemp2

.ti -3
AUTHOR

Joe Sventek wrote ls.

.ti -3
SEE ALSO

ed - text editor for description of regular expressions
.br
args - argument exploder
.br
#-h- macro           6983  asc  30-oct-80 09:14:18  tools
.bp 
.pl 60 
.rm 70 
.in 0 
.he *MACRO*05/20/78*MACRO* 
.fo //-#-// 
.fi 
.in 7 
.ti -7 
NAME 
.br 
macro - process macro definitions 
.sp 1 
.ti -7 
SYNOPSIS 
.br 
.bo 
macro 
[file] ... 
.sp 1 
.ti -7 
DESCRIPTION 
.br 
Macro reads the source file(s) and writes onto the standard output 
a new file with the macro definitions deleted and the macro 
references expanded.  If no file names are specified, the standard 
input is read. 
  
Macros are generally used to extend some underlying language to perform a 
translation from one language to another; that is, a macro 
processor allows one to define symbolic constants so that subsequent 
occurrences of the constant are replaced by the defining 
string of characters. 
The general format is: 
  
.ce 
define(name,replacement text) 
  
All subsequent occurrences of "name" in the file will be replaced 
by "replacement text".  Blanks are significant and may occur only 
inside the replacement text. 
Upper and lower case letters are also significant. 
Nesting of definitions is allowed, as is recursion. 
The definition may be more than one 
line long. 
  
An elementary example of a macro is: 
  
.ce 
define(EOF,-1) 
  
Thereafter, all occurrences of "EOF" in the file would be replaced 
by "-1". 
  
Macros with arguments may also be specified.  Any occurrence in 
the replacement text of "$n", where n is between 1 and 9, 
will be replaced by the nth argument when the macro is actually 
called.  For example, 
  
                define(copen,$3 = open($1,$2) 
                             if ($3 == ERR) 
                                  call cant($1)) 
  
would define a macro which, when called by "copen(name, READ, fd)" 
would expand into: 
  
                fd = open(name,READ) 
                if (fd == ERR) 
                     call cant(name) 
  
If a macro definition asks for an argument that wasn't supplied, 
the "$n" will be ignored. 
  
Macros can be nested, and any macros encountered during argument 
collection are expanded immediately--unless they are surrounded 
by brackets "[]".  That is, any input surrounded by [ and ] is 
left absolutely alone, except that one level of [ and ] is 
stripped off. 
Thus it is possible to write the macro "d" as 
  
.ce 
define(d,[define($1,$2)]) 
  
The replacement text for "d", protected by the brackets is 
literally "define($1,$2)" so one could say 
  
.ce 
d(a,bc) 
  
and be assured that "a" would be defined to be "bc". 
Brackets must also be used when it is desired to redefine an 
identifier: 
  
.ce 
define(x,y) 
.ce 
define(x,z) 
  
would define "y" in the second line, instead of redefining "x". 
To avoid redefining "y", the operation must be expressed as 
  
                                 define(x,y) 
                                 define([x],z) 
  
The macro processor also includes a conditional test, with the 
built-in function "ifelse".  The input 
  
.ce 
ifelse(a,b,c,d) 
  
compares "a" and "b" as character strings.  If they are the same, 
"c" is pushed back onto the input; if they differ, "d" is pushed 
back.  As a simple example, 
  
.ce 
define(compare,[ifelse($1,$2,yes,no)]) 
  
defines "compare" as a two-argument macro returning "yes" if its 
arguments are the same, and "no" if they are not. 
The brackets prevent the "ifelse" from being evaluated too soon. 
  
Another built-in function available is "incr".  "incr(x)" converts 
the string "x" to a number, adds one to it, and returns that as 
its replacement text (as a character string).  "x" had better be 
numeric, or the results may be undesireable.  "incr" can be used 
for tasks like 
  
                   define(MAXCARD,80) 
                   define(MAXLINE,[incr(MAXCARD)]) 
  
which makes two parameters with values 80 and 81. 
  
The third built-in function available in the macro processor 
is a function to take substrings of strings. 
  
.ce 
substr(s, m, n) 
  
produces the substring of "s" which starts at position "m" (with origin 
one), of length "n".  If "n" is omitted or too big, the rest of the 
string is used, while if "m" is out of range the result is a null 
string. 
For example, 
  
.ce 
substr(abc, 2, 1) 
  
results in "b", 
  
.ce 
substr(abc, 2) 
  
results in "bc", and 
  
.ce 
substr(abc,4) 
  
is empty. 
  
  
The last built-in function available in the macro processor is
one to perform simple arithmetic functions:
 
.ce
arith(operand1,op,operand2)
 
where the operation specified by 'op' may be + (add), - (subtract),
* (multiply), or / (divide).
Negative numbers are not handled yet.
Thus,
 
.nf
.in +20
define(add,[arith($1,+,$2)])
add(5,3)
.in -20
.fi
 
would produce the result '8'.
 
As a final example, here is a macro which computes the length 
of a character string: 
  
.ce 
define(len,[ifelse($1,,0,[incr(len(substr($1,2)))])]) 
  
Note the recursion, which is perfectly permissible. 
The outer layer of brackets prevents all evaluation as the 
definition is being copied into an internal table.  The inner 
layer prevents the "incr" construction from being done as the 
arguments of the "ifelse" are collected. 
The value of a macro call "len(abc)" would be 3. 
.sp 1 
.ti -7 
FILES 
.br 
None 
.sp 1 
.ti -7 
SEE ALSO 
.br 
.nf 
Kernighan and Plauger's "Software Tools", pages 251-283 
.fi 
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
.fi 
arg stack overflow 
.br 
.in +4 
The maximum number of total arguments has been exceeded.  Currently 
this is 100. 
  
.in -4 
call stack overflow 
.br 
.in +4 
The maximum level of nesting of definitions has been exceeded. 
Currently this is 130. 
  
.in -4 
EOF in string 
.br 
.in +4 
An end-of-file has been encountered before a bracketed string has 
been terminated. 
  
.in -4 
evaluation stack overflow 
.br 
.in +4 
The total number of characters for name, definition, and arguments 
has been exceeded.  Currently this is 500. 
  
.in -4 
unexpected EOF 
.br 
.in +4 
An end-of-file was reached before the macro definition was terminated. 
  
.in -4 
filename: cant open 
.br 
.in +4 
For some reason, the file specified could not be opened. 
This is an unlikely error to occur; if it does show up it probably 
indicates a problem with the low-level primitives being used 
by the system. 
.br 
.in -4 
.sp 1 
.ti -7 
AUTHORS 
.br 
From "Software Tools" by Kernighan and Plauger, with minor 
modifications by Debbie Scherrer. 
.sp 1 
.ti -7 
BUGS/DEFICIENCIES 
.br 
There can be no space between the "define" and the left-parenthesis 
following it. 
  
Keywords (e.g. define, ifelse, etc.) in the input file must be 
surrounded by brackets if they are not part of a macro--otherwise 
they will be stripped out by the processor.  Likewise, if brackets 
are desired anywhere in the input file other than in a macro, they 
must be surrounded by brackets themselves. 
  
The error messages generated by the ratfor compiler when processing 
macros do not seem to show up in this processor.  Examples are 
"definition too long", "missing comma in define", and "non-alphanumeric 
name". 
#-h- mail            2242  asc  30-oct-80 09:14:20  tools
.in 5
.rm 70
.pl 60
.he 'MAIL'1/11/79'MAIL'
.fo //-#-/
.bp 1
NAME
.in +3

mail
- utility for sending mail to local users

.ti -3
SYNOPSIS

mail [+r] [+e] [+llistfile] ... [addressee] ...

.ti -3
DESCRIPTION

mail
is a tool designed to allow the user to send mail to
fellow users of any system which supports the software tools shell.  It
operates as follows:

.in +5
.rm -2
The addressees specified in
the command line and in any mailing list files specified are
validated.  If there were any valid users, the standard input is
read up to an end-of-file and then mailed to each valid user with
an appropriate postmark. (Note: if one wishes to terminate the mail
session without sending any mail, type a line consisting of only
the letter
q
[for quit] during the input of mail.)
Mailing list files are specified with
the
+l
switch in the command line.  The structure of the mailing
list files is described below.  The
+r
switch indicates to
mail
that the user wishes to be notified as the mail is posted to each
addressee ('posted' implying that the mail has been appended successfully to the
addressee's mail file).  The names of valid users may be obtained
by prior invocation of the
users
command.  The
+e
flag will cause the editor "ed" to be invoked, allowing the user
to perform complex mail composition.
.sp
.in -5
.rm +2
The mailing list files have a very simple structure: user names
separated by blanks and tabs, with as many users per line as
desired.  A pound sign (#) appearing anywhere on a line indicates
the start of a comment field, and the rest of the line is ignored
by mail.  This allows the user complete flexibility in commenting
her/his mailing lists for informational purposes.
.sp
Broadcast mailings are supported, also.  One must merely specify
all
as an addressee in the command line.
.sp
.ti -3
FILES
.sp
mymail
- file for storage of each users mail
.br
mbox
- file for storage of saved mail
.br
three temporary files are used by mail
.sp
.ti -3
SEE ALSO
.sp
users
- a program to list users on current host
.br
postmn
- a program which notifies user of existence of mail
.br
msg - the utility for reading and sorting one's mail
.sp
.ti -3
AUTHOR
.sp
mail was written by Joe Sventek
.sp
.ti -3
BUGS/DEFICIENCIES
.br
#-h- man              685  asc  30-oct-80 09:14:21  tools
.bp 
.rm 70 
.in 0 
.he 'MAN'1/11/79/'MAN'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
man - run off section of users manual
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
man
[toolname] ...
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Man
locates and prints a section of the
users manual describing the use of a particular tool.
If no arguments are specified, all of manual entries are printed out.
.sp 1
.in 
FILES 
.br 
.in 7 
Accesses the file containing user documents.
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The tool 'intro'; the Unix command 'man'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if the tool specified by 'toolname' cannot be
located.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Dennis Hall
#-h- mv               683  asc  30-oct-80 09:14:21  tools
.bp 
.rm 70 
.in 0 
.he 'MV'1/11/79'MV'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
mv - move (or rename) a file
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
mv
file1 file2
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Mv
changes the name of 
file1
to
file2.
If file2 already exists, it is removed before file1 is renamed.
On networks or other systems where a simple rename is impossible,
mv
copies the file and then deletes the original.
.sp 1
.in 
FILES 
.br 
.in 7 
None
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The Unix command 'mv'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if file1 does not exist.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Joe Sventek, Debbie Scherrer
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- os               841  asc  30-oct-80 09:14:22  tools
.bp 
.rm 70 
.in 0 
.he 'OS'1/16/79'OS'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
os - overstrike - convert backspaces into multiple lines
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
os
[file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Os
(overstrike) looks for backspaces in the files specified and 
generates a sequence of print lines with carriage control codes
to reproduce the effect of the backspaces.
 
If no files are given, or the filename '-' appears, input is
taken from the standard input.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
lpr
.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 & Plauger's 'Software Tools', with modifications
by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- pwd              561  asc  30-oct-80 09:14:22  tools
.in 7
.rm 70
.pl 62
.he /PWD/%/PWD/
.fo //-#-/
.bp
.ti -7
NAME
.sp
pwd - print working directory name on standard output
.sp
.ti -7
SYNOPSIS
.sp
pwd [-l]
.sp
.ti -7
DESCRIPTION
.sp
pwd
prints the pathname of the working (current default) directory.
If the -l switch is present, the current working directory is printed
out in the local parlance.
This
path name is of the form
.sp
/device/directory
.sp
For example,
.sp
.ce
/dp00/105,1
.sp
is equivalent to
.sp
.ce
dp00:[105,1]
.sp
on RSX and IAS machines.
.sp
.ti -7
SEE ALSO
.sp
cwd - change working directory
#-h- rat4           15755  asc  30-oct-80 09:14:23  tools
..... For VAX/VMS and RSX versions, use .pl 62
.pl 62
.bp 
.in 0 
.he 'RAT4'06/12/80'RAT4'
.fo ''-#-'' 
.fi 
.in 7 
.ti -7 
NAME 
.br 
rat4 - Ratfor preprocessor
.sp 1 
.ti -7 
SYNOPSIS 
.br 
rat4 [files ...] >outfile
.sp 1 
.ti -7 
DESCRIPTION 
.br 
rat4 translates the ratfor programs in the named files into Fortran.
If no input files are given, or the filename '-' appears, the
standard input will be read.
 
A file containing general purpose software tools definitions
(e.g. EOF, NEWLINE, EOS, etc.) will be automatically opened and
processed before any of the files specified are read.
.sp 2 
Syntax:
 
Ratfor has the following syntax:
.nf
           prog:   stmt
                   prog stmt
           stmt:   if (expr) stmt
                   if (expr) stmt else stmt
                   while (expr) stmt
                   repeat (expr) stmt
                   repeat stmt until (expr)
                   for (init expr; test expr; incr expr) stmt
                   do expr stmt
                   do n expr stmt
                   break
                   break n
                   next
                   next n
                   return (expr)
                   switch (expr)
                     {
                     case expr:  stmt
                     ....
                     default: stmt
                     }
                   digits stmt
.mc | 2
                   { prog }  or  [ prog ]
.mc
                   anything unrecognizable (i.e. fortran)
           
.fi
where 'stmt' is any Fortran or Ratfor statement.
A statement is terminated by an end-of-line or a semicolon.
.sp
.ne 11
Character Translation:
.sp
The following character translations are performed:
.in +5
.nf
<       .lt.
<=      .le.
==      .eq.
!=      .ne.         ^=      .ne.         ~=      .ne.
>=      .ge.
>       .gt.
|       .or.
&       .and.
!       .not.        ^       .not.        ~       .not.
.in -5
.fi
.sp 2
Included files:
 
.fi
The statement
 
.in +15
.nf
include file        or
include "file"
.in -15
 
.fi
will insert the contents of the specified file into the ratfor input
in place of the 'include' statement.
Quotes must surround the file name if it contains characters other
than alphanumerics, underscores, or dots.
.sp 2
.mc | 2
Macro Definitions:

The statement

.ti +15
define(name,replacement text)

defines 'name' as a macro which will be replaced with the indicated text
when encountered in the source files.  Any occurrences of the strings
'$n' in the replacement text, where 1 <= n <= 9, will be replaced with the
nth argument when the macro is actually invoked.  For example:

.ti +15
define(bump, $1 = $1 + 1)

will cause the source line

.ti +15
bump(i)

to be expanded into

.ti +15
i = i + 1

The names of macros may contain letters, digits, periods and underline
characters, but must start with a letter (e.g. B.FLAG).  Upper case is
not equivalent to lower case in macro names.

The replacement text is copied directly into the lookup table with no
intepretation of the arguments, which differs from the procedure used in
the macro utility.  This "deferred evaluation" has the effect of eliminating
the need for quoting strings to get them through the macro processor
unchanged.  A side effect of the deferred evaluation is that defined names
cannot be forced through the processor - i.e. the string define will never
be output from the preprocessor.
The inequivalence of upper and lower case in macro names may be used in this
case to force the name of a user defined macro onto the output - i.e. if the
user has defined a macro named mymac, the replacement text may contain the
string MYMAC, which is not defined, and will pass through the processor.

In addition to define, four other built-in macros are provided:

.in +17
.ti -16
arith(x,op,y)   performs the "integer" arithmetic specified by op (+,-,*,/)
on the two numeric operands and returns the result as its replacement.
.ti -16
incr(x)         converts the string x to a number, adds one to it, and returns
the value as its replacement (as a character string).
.ti -16
ifelse(a,b,c,d) compares a and b as character strings; if they are the same,
c is pushed back onto the input, else d is pushed back.
.ti -16
substr(s,m,n)   produces the substring of s which starts at position m
(with origin one), of length n.  If n is omitted or too big, the rest of
the string is used, while if m is out of range the result is a null string.
.in -17

Note: the statement

.ti +15
define name text

may also be used, but will not always perform correctly for macros with
parameters or multi-line replacement text.  It is suggested that the functional
form be preferred.


.ne 9
Conditional Preprocessing:

The statements

.in +15
ifdef(macro,text)
.br
ifnotdef(macro,text)
.in -15

conditionalize the preprocessing upon whether the macro has been previously
defined or not.
.br
.mc


String Data Types:
 
The statements
 
.in +10
string name "character string"          or
.br
string name(size) "character string"
 
.in -10
declare 'name' to be a character array long enough to accomodate
the ascii codes for the given character string, one per array
element.
The array is then filled by data statements.
The last word of 'name' is initialized to the symbolic parameter
EOS, and indicates the end of a string.
EOS must be defined either in the standard definitions file or
by the user.
If a size is given, name is declared to be a character array
of 'size' elements.
If several string declarations appear consecutively, the 
generated declarations for the arrays will precede the data
statements that initialize them.
Escape sequences are recognized in string declarations, such that
@n maps into the NEWLINE character and @t maps into the TAB character.
@c for any other character simply maps into the character c.  In
particular, to embed an atsign '@' in a string, one must type '@@'.
.sp 2
String Literals:
 
Conversion of in-line quoted strings to hollerith constants is performed
in the following manner:
 
.in +5
.nf
"str"         nHstr     
'str'         nHstr
         (where 'n' is the number of characters in str)
.in -5
.br
.fi
String literals can be continued across line boundaries by ending
the line to be continued with an underline.
The underline is not included as part of the literal.
Leading blanks and tabs on the next line are ignored.
.sp 2
Integer Constants:
 
Integer constants in bases other than decimal may be specified
as n%dddd... where 'n' is a decimal number indicating
the base and 'dddd...' are digits in that base.
For bases > 10, letters are used for digits above 9.
Examples include:  8%77 (=63), 16%2ff (=767), 2%0010011 (=19).
The number is converted to the equivalent decimal value using
multiplication; this may cause sign problems if the number has
too many digits.
.sp 2
Lines and Continuation:
 
.fi
Input is free-format; that is, statements may appear anywhere
on a line.
Lines ending with a comma, +, -, or * are assumed to be continued
on the next line.
An exception to this rule is within a condition; the line
is assumed to be continued if the condition does not fit on one line.
Explicit continuation is indicated by ending a line with an
underline character (_).
The underline character is not copied to the output file.
.sp 2
Comments:
 
Comments are preceded by '#' signs and may appear anywhere in
the code.
.sp 2
Literal (unprocessed) Lines:
 
Lines can be passed through rat4 without being processed by
preceding and following the blocks of lines with a line containing
only a '%'.
The '%' lines will not be copied to standard output.
.sp 4
.ti -7
CHANGES
.br
This ratfor preprocessor differs from the original (as released
by Kernighan and Plauger) in the following ways:
 
The code has been rewritten and reorganized for clarity.
 
A hash table has been added for increased efficiency in searching
the definitions list.
 
The 'string' data type has been included.
 
.mc | 2
The define processor has been augmented to support macros with arguments.

Conditional preprocessing upon the definition (or lack therof) of a
symbol has been included.
.br
.mc

Many extraneous gotos have been avoided.
 
Some blanks have been included in the output for increased readability.
 
Multi-level 'break' and 'next' statements have been included.
 
The Fortran 'DO' is allowed, as well as the ratfor one.
 
The capability of specifying integer constants in bases other than
decimal has been added.
 
Underscores and dots have been allowed in defined names.
 
The 'define' syntax has been expanded to include the form:
.ce
define name value
 
The 'return(value)' feature has been added.
 
Quoted file names following 'include' statements have been added
to allow for special characters in file names.
 
A toggle for allowing lines to pass through un-processed has been added.
 
The 'switch' control statement has been included.
 
Continuation lines have been implemented.
 
.mc | 2
Brackets have been allowed to replace braces.
.br
.mc
.sp 3
.ti -7 
FILES 
.br 
A generalized definition file (e.g. 'ratdef') is automatically
opened and read.
.sp 3 
.ti -7 
SEE ALSO 
.br 
.nf 
Kernighan and Plauger's "Software Tools" 
Kernighan's "RATFOR - A Preprocessor for a Rational Fortran" 
The Unix command rc in the Unix Manual 
The tools 'incl' and 'macro'
.fi 
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
(The errors marked with asterisk '*' are fatal; all others are simply
warning messages.)
.sp 1
.in +5
.mc | 2
.ti -5
* arg stack overflow
.br
The argument stack for the macro processor has been exceeded.  The size of the
stack is determined by the symbol ARGSIZE in the file macsym.
.br
.mc
.ti -5
* buffer overflow
.br
One of the preprocessor's internal buffers overflowed,
possibly, but not necessarily, because the string buffers
were exceeded.
The definition SBUFSIZE in the preprocessor symbols file 
determines the size
of the string buffers.
.br
.ti -5
.mc | 2
* call stack overflow
.br
The call stack (used to store call frames) in the macro processor has
been exceeded.  The definition CALLSIZE in the file macsym determines the
size of this stack.
.br
.mc
.ti -5
can't open standard definitions file
.br
The special file containing general purpose ratfor definitions
could not be opened, possibly because it did not exist or the
user did not have access to the directory on which it resides.
.br
.ti -5
can't open include 
.br 
File to be included could not be located,
the user did not have privilege to access it,
or the file could not be opened due to some problem in the
local primitives.
.br 
.ti -5 
* definition too long 
.br 
The number of characters in the name to be defined exceeded 
Ratfor's internal array size.
The size is defined by the MAXTOK definition in the preprocessor 
symbols file.
.br 
.ti -5
.mc | 2
* EOF in string
.br
The macro processor detected an EOF in the current input file while
evaluating a macro.
.ti -5
* evaluation stack overflow
.br
The evaluation stack for the macro processor has been exceeded.
This stack's size is determined by the symbol EVALSIZE in the file macsym.
.br
.mc
.ti -5
* for clause too long
.br
The internal buffer used to hold the clauses for the 'for'
statement was exceeded.
Size of this buffer is determined by the MAXFORSTK definition
in the preprocessor symbols file.
.br
.ti -5
* getdef is confused
.br
There were horrendous problems when attempting to access
the definition table
.br
.ti -5 
illegal break 
.br 
Break did not occur inside a valid "while", "for", or "repeat" loop 
.br 
.ti -5 
illegal else 
.br 
Else clause probably did not follow an "if" clause 
.br 
.ti -5 
illegal next 
.br 
"Next" did not occur inside a valid "for", "while", or "repeat" loop 
.br 
.ti -5 
illegal right brace 
.br 
A right brace was found without a matching left brace 
.br 
.ti -5 
includes nested too deeply 
.br 
There is a limit to the level of nesting of included files.
It is dependent upon the maximum number of opened files allowed
at a time,
and is set by the
NFILES definition in the preprocessor symbols file.
.br 
.ti -5 
invalid for clause 
.br 
The "for" clause did not contain a valid init, condition, and/or 
increment section 
.ti -5
invalid string size
.br
The string format 'string name(size) "..."' was used, but the
size was given improperly.
.br
.ti -5 
* missing comma in define 
.br 
Definitions of the form 'define(name,defn)' must include the
comma as a separator.
.br 
.br 
.ti -5
missing function name
.br
There was an error in declaring a function
.br
.ti -5 
missing left paren 
.br 
A parenthesis was expected, probably in an "if" statement, but 
not found 
.br 
.ti -5 
missing parenthesis in condition 
.br 
A right parenthesis was expected, probably in an "if" statement, 
but not found 
.br 
.ti -5 
missing quote 
.br 
A quoted string was not terminated by a quote 
.br 
.ti -5 
missing right paren 
.br 
A right parenthesis was expected in a Fortran (as opposed to 
Ratfor) statement but not found 
.br 
.ti -5
missing string token
.br
No array name was given when declaring a string variable
.br
.ti -5 
* non-alphanumeric name 
.br 
Definitions may contain only alphanumeric characters, dots,
and underscores.
.br 
.ti -5 
* stack overflow in parser 
.br 
Statements were nested at too deep a level. 
The stack depth is set by the MAXSTACK definition in the
preprocessor symbols file.
.br 
.ti -5 
token too long 
.br 
A token (word) in the source code was too long to fit into one 
of Ratfor's internal arrays. 
The maximum size is set by the MAXTOK definition in the
preprocessor symbols file.
.br 
.ti -5 
* too many characters pushed back 
.br 
The source code has illegally specified a Ratfor command, or has 
used a Ratfor keyword in an illegal manner, and the parser has 
attempted but failed to make sense out of it 
The size of the push-back buffer is set by BUFSIZE in the
preprocessor symbols file.
.br 
.ti -5 
too many definitions 
.br 
Ratfor's internal arrays could not hold all the definitions. 
The size of the definition table is determined by the MAXTBL
and MAXPTR definitions in the preprocessor symbols file.
.br 
.ti -5 
unbalanced parentheses 
.br 
Unbalanced parentheses detected in a Fortran (as opposed 
to Ratfor) statement 
.br 
.ti -5 
unexpected brace or EOF 
.br 
A brace occurred after a Fortran (but not Ratfor) statement 
or an end-of-file was reached before the end of a statement 
.br 
.ti -5 
unexpected EOF 
.br 
An end-of-file was reached before all braces had been 
accounted for.  This is usually caused by unmatched braces 
somewhere deep in the source code. 
.br 
.ti -5 
warning:  possible label conflict 
.br 
This message is printed when the user has labeled a statement 
with a label in the 23000-23999 range.  Ratfor statements are 
assigned in this range and a user-defined one may conflict 
with a Ratfor-generated one. 
.br 
.ne 3
.ti -5 
"file":  cannot open
.br 
Ratfor could not open an input file specified by the user
on the command line.
.br 
.in -5
.sp 2 
.ti -7 
AUTHORS 
.br 
Original by B. Kernighan and P. J. Plauger, with rewrites and
enhancements by David Hanson and friends (U. of Arizona),
Joe Sventek and Debbie Scherrer (Lawrence Berkeley Laboratory).
.sp 1 
.ti -7 
BUGS/DEFICIENCIES 
.br 
  
The line numbers given in error messages are NOT correct. 
They indicate only a general area in which to look for the error. 
  
Missing parentheses or braces may cause erratic behavior, including a 
read-past-eof message.  Eventually  Ratfor should be taught 
to terminate parentheses/brace checking at the end of each subroutine. 
 
Extraneous 'continue' statements are generated within Fortran
'do' statements.
 
There is no way to explicitly cause a statement to begin in column 6
(i.e. a Fortran continued statement),
although implicit continuation is performed.
#-h- rc              1697  asc  30-oct-80 09:14:27  tools
.in 5
.rm 70
.he /RC/%/RC/
.fo //-#-/
.bp 1
.in +3
.ti -3
NAME

rc
- ratfor compiler

.ti -3
SYNOPSIS

rc [-c] [-r] [-f] [-v] [-o] file ...

.ti -3
DESCRIPTION

rc
is the ratfor compiler.  It accepts the following types of arguments:

.in +3
.ti -3
1. Files whose names end in '.r' are assumed to be ratfor source programs;
they are preprocessed into fortran and compiled.  The preprocessed file
for name.r is placed on name.f and the compiled object code appears on
name.obj.  The name.f file is removed unless -f is specified (see below).

.ti -3
2. Five flags which affect the actions of the compiler are:

.in +3
.ti -3
-c
suppress the loading phase, as does any preprocessing or compilation error
.ti -3
-r
ratfor only; don't compile fortran; implies -f and -c
.ti -3
-f
save fortran intermediate files; usually for debugging purposes
.ti -3
-v
verbose option; prints name of each file as it is preprocessed and
prints name of each '.f' file as it is compiled
.ti -3
-o
generates fortran listing for name.f on name.l

.in -3
.ti -3
3. Files whose names end in '.f' are assumed to be fortran source programs,
and are compiled.  Other arguments are assumed to be loader flags, or
object files, typically created by an earlier
rc
or
fc
run.  These files, together with the results of any compilations, are loaded
to produce an executable process.

.in -3
.ti -3
SEE ALSO

rat4, the ratfor preprocessor, for descriptions of the language and for a more
general way of performing the preprocessing.
.br
fc, the fortran compiler
.br
ld, the loader, for loader flags and process naming conventions

.ti -3
AUTHOR

Joe Sventek wrote the interface of
rc
to rat4, fc, and ld.

.ti -3
BUGS

none to date
#-h- resolve          720  asc  30-oct-80 09:14:27  tools
.in 0
.rm 70
.pl 60
.he :RESOLVE:6/8/79:RESOLVE:
.fo ::-#-:
.bp
.in +7
.ti -7
NAME
.br
resolve - resolve mail system user names
.sp
.ti -7
SYNOPSIS
.br
resolve expression [expression ...]
.sp
.ti -7
DESCRIPTION
.br
resolve
searches the mail database for lines matching the text pattern
"expression". (Valid text patterns are the same as for find.)  Resolve
will display on the standard output all lines which match any one of
the given expressions.
.sp
.ti -7
FILES
.br
.sp
.ti -7
SEE ALSO
.br
find - search a file for text patterns
.br
mail - software tools mail facility
.br
users - list users to whom mail may be sent
.sp
.ti -7
DIAGNOSTICS
.br
None
.sp
.ti -7
AUTHOR
.br
Joe Sventek
.sp
.ti -7
BUGS/DEFICIENCIES
.br
#-h- rm               515  asc  30-oct-80 09:14:28  tools
.bp 
.rm 70 
.in 0 
.he 'RM'1/11/79'RM'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
rm - remove files
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
rm
name ...
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Rm
removes the files specified.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The Unix command 'rm'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if the file could not be removed.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Joe Sventek (DEC machines); Debbie Scherrer (CDC machines)
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- roff            5960  asc  30-oct-80 09:14:29  tools
.bp
.pl 60
.rm 70
.in 0
.#.he (the date exists in more than one place; be careful!)
.he !ROFF!07/26/78!ROFF!
.in 7
.fo ""-#-
.fi
.ti -7
NAME
.br
roff -- format text
.sp 1
.ti -7
SYNOPSIS
.br
roff  [+n] [-n] [-s] [-pon] [name ... ]
.cc +
+sp 1
+ti -7
DESCRIPTION
+br
'Roff'
formats text according to
'request lines'
embedded in the text of
the given
file names.
If nonexistent file names are encountered they are ignored.
The optional flag arguments mean:
+sp
+in +10
+ti -3
+cc ,
+n
Start printing at the first page with number 'n'.
,cc +
+sp
+ti -3
-n
Stop printing at the first page numbered higher than 'n'.
+sp
+ti -3
-s
Stop before each page, including the first (useful for
paper manipulation).
The prompt "Position paper, then hit CR to continue" is
given just once before the first page.
+sp
+ti -5
-pon
Move the entire document 'n' spaces (default=0) to the right
('page offset').
+sp
+in -10
Input consists of intermixed text lines, which contain information to be
formatted, and request lines, which contain instructions about how to format
the text lines.
Request lines begin with a distinguishing 'control character', normally a
period.  Lines having leading spaces are output without
modification.  Strings of embedded spaces are retained so that
the output line will contain at least as many spaces between words
as the input line.
+sp
Output lines may be 'filled' without regard to
the format of the input text lines.
Right justification of filled lines may be turned on and off through
the use of the '.ju' and '.nj' request lines.
Line 'breaks' may result from the use of certain request lines, or by the
appearance of an empty input line or an input line beginning with a space.
+sp
Normally, at least one space is placed between the last word of
a line and the first word of the next.  This feature may be
suppressed by issuing the '.bs' request line, which will suppress the
space between the last word of the previous line and the first
word of the following line.  All other words in the following
line are treated in the usual manner.
+sp
The capabilities of roff are specified in the attached 'Request Summary'.
Numerical values are denoted there by 'n', titles by 't', and single
characters by 'c'.
Numbers denoted 'n' may be signed + or -, in which case they signify
relative changes to a quantity; otherwise they signify an absolute
setting.
Missing 'n' fields are ordinarily taken to be 1, missing 't' fields to be
empty, and 'c' fields to shut off the appropriate special interpretation.
+sp
Running titles may appear at the top and bottom of every page.
The head and foot for this writeup was set by:
+sp
+ti +5
.he 'ROFF'07/26/78'ROFF'
+br
+nf
+ti +5
.fo ''-#-
+sp
+fi
A title line consists of a line with three distinct fields:
the first is text to be placed flush with the left margin, the
second centered, and the third flush with the right margin.
The first non-blank character in the title is used as the
'delimiter' to separate the three fields.
Any '#' characters in a title are replaced by the current page number.
+sp 1
+ne 5
+ti -7
FILES
+br
None
+sp
+ti -7
SEE ALSO
+br
The "Software Tools" book, pages 219-250.
+br
The "UNIX Programmer's Manual", ROFF(I) and NROFF(I)/TROFF(I).
+br
The 'nroff' and 'troff' user's manuals by Joseph F. Ossanna,
Bell Laboratories, Murray Hill, New Jersey.
+sp 1
+ti -7
DIAGNOSTICS
+br
None
+sp
+ti -7
AUTHORS
+br
This tool was obtained from the book "Software Tools"
by Kernighan and Plauger; it was initially adapted to BKY (including the
'-n', '+n', '-s' and '-pon' flags)
by Debbie Scherrer.
Minor additions were made by Donn Davy and Dennis Hall.
Roff was originally prepared for installation by Brad Heckman.
Substantial enhancements were added by Joe Sventek.
+sp 1
+ti -7
BUGS/DEFICIENCIES
+br
The '.bs' directive does not always work at the end of filled lines.
+sp 1
+ne 34
+ti -7
REQUEST SUMMARY
+sp
+nf
+in
Request Initial Default Break Meaning
+sp
.bd n           n=1     no    Boldface the next 'n' lines.
.bp n     n=1   n=+1    yes   Begin new page and number it 'n'.
.br                     yes   The filling of the current line is stopped.
.bs n           n=1     no    Suppress blanks between words on adjacent lines.
.cc c     c=.   c=.     no    Control character becomes 'c'.
.ce n           n=1     yes   Center the next 'n' input lines without filling.
.ef t     t=''  t=''    no    Foots on even pages are 't'.
.eh t     t=''  t=''    no    Heads on even pages are 't'.
.fi       yes           yes   Begin filling output lines.
.fo t     t=''  t=''    no    All foot titles are 't'.
.he t     t=''  t=''    no    All head titles are 't'.
.in n     n=0   n=0     yes   Set left margin to column 'n+1'.
.ju             yes     no    Right justify filled lines.
.ls n     n=1   n=1     no    Line spacing set to 'n' lines per output line.
.m1 n     n=3   n=1     no    Put 'n' blank lines between top of page and head.
.m2 n     n=2   n=1     no    Put 'n' blank lines between head and text.
.m3 n     n=2   n=1     no    Put 'n' blank lines between text and foot.
.m4 n     n=3   n=1     no    Put 'n' blnk lns between foot and bottom of page.
.ne n           n=0     y/n   Begin new page if 'n' lines won't fit on output.
                              Break if need to start new page; don't if not.
.nf       no            yes   Stop filling output lines.
.nj       no            no    Do not right justify filled lines.
.of t     t=''  t=''    no    Foots on odd pages are 't'.
.oh t     t=''  t=''    no    Heads on odd pages are 't'.
.pl n     n=66  n=66    no    Total page length is 'n' lines.
.po n     n=0   n=0     no    Page offset; precede all lines by 'n' spaces.
.rm n     n=65  n=65    no    Set right margin to column 'n'.
.sp n           n=1     yes   Insert 'n' blank lines, except at top of page.
.ti n           n=0     yes   Temporarily indent next output line 'n' spaces.
.ul n           n=1     no    Underline the next 'n' lines.
+sp
+cc .
#-h- sh              8726  asc  30-oct-80 09:14:31  tools
.he 'SH'1/16/79'SH'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
sh - shell (command line interpreter)
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
sh
[-vnx] [name [arg1 ..[arg9]]].
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Sh
is a command line interpreter:
it reads lines typed by the user and interprets them as requests to
execute other programs.
 
 
Commands.
.br
In simplest form, a command line consists of the command name followed
by arguments to the command, all separated by spaces:
.ce
command arg1 arg2 ... argn
The shell splits up the command name and the arguments into separate
strings.
Then a file with name
command
is sought;
command
may be a path name to specify any file in the system.
If
command
is found, it is brought into memory and executed.
The arguments collected by the shell are accessible to the command.
When the command is finished, the shell resumes its own execution and
indicates its readiness to accept another command by typing a
prompt character.
 
If file
command
cannot be found in the current directory or through its pathname, the
shell searches a specific system directory of commands intended
to be available to sh users in general.
 
An example of a simple command is:
.ce
sort list
which would look for the tool 'sort' in the current directory,
then in the system directory, and
then sort the contents of file 'list', printing the
output at the user's terminal.
 
Some characters on the command line have special meanings to the
shell (these are discussed below).
The character '@' may be included anywhere in the command line
to cause the following character to lose any special meaning
it may have to the shell (to be 'escaped').
Sequences of characters enclosed in double (") or single (')
quotes are also taken literally.
 
 
Standard I/O
.br
Shell programs in general have open three standard files:
'input', 'output', and 'error output'.
All three are assigned to the user's terminal unless redirected by
the special arguments '<', '>', '?', '>>', '??', (and sometimes
'-').
 
An argument of the form '<name' causes the file
'name' to be used as the standard input file of the associated
command.
 
An argument of the form '>name' causes file 'name' to be used
as the standard output.
 
An argument of the form '?name' causes the file 'name' to be used
as the standard error output.
 
Arguments of the form '>>name' or '??name' cause program output
to be appended to 'name' for standard output or error output
respectively.
If 'name' does not exist, it will be created.
 
Most tools have the capability to read their input from a series
of files.
In this case, the list of files overrides reading from standard
input. 
However, many of the tools allow the user to read from both a list
of files and from input by specifying the filename '-' for
standard input.
For example,
.ce
roff file1 - file2
would read its input from 'file1', then from the standard input,
then from 'file2'.
 
 
Filters and Pipes.
.br
The output from one command may be directed to the input of another.
A sequence of commands separated by vertical bars (|) or carets ('^')
causes the shell to arrange that the standard output of each command
be delivered to the standard input of the next command in sequence.
Thus in the command line:
.ce
sort list | uniq | crt
'sort' sorts the contents of file 'list';
its output is passed to 'uniq',
which strips out duplicate lines.
The output from 'uniq' is then input to 'crt', which prepares
the lines for viewing on the user's crt terminal.
 
The vertical bar is called a 'pipe'.
Programs such as 'sort', 'uniq', and 'crt', which copy standard
input to standard output (making some changes along the way) are called
'filters'.

 
Command separators
.br
Commands need not be on different lines; instead they may be 
separated by semicolons:
.ce
ar t file; ed
The above command will first list the contents of the archived
file 'file', then
enter the editor.
 
The shell also allows commands to be grouped together with
parentheses, where the group can then be used as a filter.
For example,
.ce
(date; cat chocolate) | comm vanilla
writes first the date and then the file 'chocolate' to standard
output, which is then read as input by 'comm'.
This tool compares the results with existing file 'vanilla' to
see which lines the two files have in common.
 
 
Multitasking 
.br
On many systems the shell also allows processes to be executed
in the background.
If a command is followed by '&', the shell will not wait for the
command to finish before prompting again; instead,
it is ready immediately to accept a new command.
For instance,
.ce
rat4 ambrose >george &
preprocesses the file 'ambrose', putting the output on 'george'.
No matter how long the compilation takes, 
the shell returns immediately.
The identification number of the process running that command is
printed.
This identification may be used to wait for the completion of
the command or to terminate it.
 
The '&' may be used several times in a line.
Parentheses and pipes are also allowed (within the same background
process).
 
 
Script files.
.br
The shell itself is a command, and may be called recursively,
either implicitly or explicitly.
This is primarily useful for executing files containing lines
of shell commands.
For instance, suppose you had a file named 'nbrcount' 
which looked like this:
.in +15
.nf
echo 'Counting strings of digits'
tr <program 0-9 9 | tr !9 | ccnt
.fi
.in -15
These commands count all the digit strings in 'program'.
You could have the shell execute the commands by typing:
.ce
sh nbrcount
The shell will also execute script files implicitly.
For example, giving the command
.ce
nbrcount
would cause the shell to notice that the file 'nbrcount' contained
text rather than executable code.
The shell would then execute itself again, using 'nbrcount' as
its input.
 
Arguments may also be passed to script files.
In script files, character sequences of the form '$n', 
where n is a digit between 1 and 9, are replaced by the
nth argument to the invocation of the shell.
For instance, suppose the file 'private' contained the following
commands:
.in +15
.nf
cat $1 $2 $3 | crypt key >$4
ar u loveletters $4
.fi
.in -15
Then, executing the command
.ce
private Dan John Harold fair
would merge the files 'Dan', 'John', and 'Harold', encrypt
them, and store them away in an archive under the name 'fair'.
 
Script files may be used as filters in pipelines just like regular
commands.
 
Script files sometimes require in-line data to be available to them.
A special input redirection notation "<<" is used to achieve this effect.
For example, the editor normally takes its commands from the standard
input.
However, within a shell procedure commands could be embedded this way:
   
                           ed file <<!
                           editing requests
                           !
 
The lines between <<! and ! are called a 'here' document; they are read
by the shell and made available as the standard input.
The character '!' is arbitrary, the document being terminated by a line
that consists of whatever character followed the <<.
 
 
  
Shell Flags.
.br
The shell accepts several special arguments when it is invoked.
The argument -v asks the shell to print each line of a script
file as it is read as input.
For instance,
.ce
sh -v private Jasmine Irma Jennifer twostars
would print each line of the script file 'private' as soon as
it is read by the shell.
 
The argument -x is similar to the -v above except that commands
are printed right before they are executed.
These commands will be printed in the actual format the
system expects when attempting to execute the program.
 
The argument -n suppresses execution of the command entirely.
 
The argument -c causes the remaining arguments to be executed
as a shell command.
 
 
Termination.
.br
The shell may be left by typing an end-of-file or by typing
'logout' as a command.
 
 
.in 
FILES 
.br 
.in 7 
Scratch files are created for pipelines and for 'here' documents.
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The Unix command 'sh'
.br
The Bell system Technical Journal, vol. 57, no. 6, part 2,
July-Aug 1978
 
.sp 1 
.in 
DIAGNOSTICS
.br 
.in 7 
The error message 'syntax error' appears whenever a command line
cannot be understood.
 
'Invalid command' is printed whenever a command cannot be located
in the various directories searched.
 
The message 'cannot spawn process' appears if the shell cannot
cause the system to execute the command desired.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Dennis Hall, Joe Sventek, Debbie Scherrer
.sp 1 
.in 
BUGS 
.br 
.in 7 
If a user wants to escape a shell special character that appears
as the first character of an argument, he must escape it with
quotes rather than an '@' sign.
#-h- sort            3722  asc  30-oct-80 09:14:33  tools
.bp 
.pl 60 
.rm 70 
.in 0 
.he 'SORT'04/15/78'SORT 
.fo ''-#-'' 
.fi 
.in 7 
.rm 70 
.ti -7 
.nf 
.fi 
  
.ti -7 
NAME 
  
sort - sort and/or merge text files 
  
.ti -7 
SYNOPSIS 
.ti -7 
  
sort [-bdfimr] [+sn] [file] ... 
  
.ti -7 
DESCRIPTION 
  
Sort sorts lines of all the named files together and writes the result 
on the standard output.  The name '-' means the standard input.  The 
standard input is also used if no input file names are given. 
Thus sort may be used as a filter. 
  
The sort key is an entire line. 
Default ordering is alphabetic by characters as they are represented 
in ASCII format. 
The ordering is affected by the 
following flags, one or more of which may appear. 
  
.in +4 
.ti -3 
-b Leading blanks  are not included in keys. 
  
.ti -3 
-d 'Dictionary' order: only letters, digits and blanks are significant 
in comparisons. 
  
.ti -3 
-f Fold all letters to a single case. 
  
.ti -3 
-i Ignore all nonprinting nonblank characters. 
  
.ti -3 
-m Merge only, the input files are already sorted. 
  
.ti -3
-r Reverse the sense of the sort

.ti -4
+sn Sort according to the subfield starting on column n

.in -4 
  
.ti -7 
FILES 
  
A series of scratch files are generated and subsequently deleted. 
Presently the files are named "STn" where "n" is a sequence number. 
  
.ti -7 
SEE ALSO 
  
The Unix command "sort" in the Unix User's Manual. 
.br 
  
.ti -7 
DIAGNOSTICS 
  
A message is printed if a file cannot be located. 
  
.ti -7 
AUTHORS 
  
Original design from Kernighan and Plauger's "Software Tools",  
with modifications by Debbie Scherrer.  The external merge phase 
of sort was completely rewritten by Joe Sventek.
  
.ti -7 
BUGS 
  
The merge phase is performed with a polyphase merge/sort algorithm, which
requires an end-of-run delimiter on the scratch files.  The one chosen is
a bare ^D(ASCII code 4) on a line.  If this is in conflict with your
data files, the symbol CTRLD in sortsym should be redefined and sort built
again.

Eventually all the Unix "sort" flags should be implemented. 
These include: 
.ti +5 
sort [-mubdfinrtx] [+pos] [-pos] [-o file] [file] ... 
  
The additional flags are: 
  
.ti +5 
n  An initial numeric string, consisting of optional minus sign, digits 
and optionally included decimal point, is sorted by arithmetic value. 
  
.ti +5 
.ti +5 
tx Tab character between fields is x. 
  
.ti +5 
+pos -pos 
Selected parts of the line, specified by +pos and -pos, may be used as 
sort keys.  Pos has the form m.n optionally followed by one or more 
of the flags bdfinr, where m specifies a number of fields to skip, n a 
number of characters to skip further into the next field, and the 
flags specify a special ordering rule for the key.  A missing .n is taken 
to be 0.  +pos denotes the beginning of the key; -pos denotes the first 
position after the key (end of line by default).  Later keys are 
compared only when all earlier keys compare equal.  Note:  The first 
field of a line is numbered zero. 
  
When no tab character has been specified, a field consists of nonblanks 
and any preceding blanks.  Under the -b flag, leading blanks are 
excluded from a field.  When a tab character has been specified, 
fields are strings separated by tab characters. 
  
Lines that otherwise compare equal are ordered with all bytes significant. 
  
.ti +5 
-o The next argument is the name of an output file to use instead of the 
standard output.  This file may be the same as one of the inputs, except 
under the merge flag -m. 
{Note--it is not clear why this flag is needed.] 
  
.ti +5 
-u Suppress all but one in each set of contiguous equal lines.  Ignored 
bytes and bytes outside keys do not participate in this comparison. 
#-h- spell            901  asc  30-oct-80 09:14:34  tools
.bp 
.rm 70 
.in 0 
.he 'SPELL'1/11/79'SPELL'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
spell - find spelling errors
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
spell [file] ...
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Spell
copies the named files (or standard input if none are specified) to
standard output while looking up each word in a dictionary.  If any
spelling errors are found in a particular line, an additional line
will be printed immediately following the line with asterisks (*)
beneath the offending words.
.sp 1
.in 
FILES 
.br 
.in 7 
dict - a dictionary file
.br
dictdx - the index generated by isam for the dictionary
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
isam - generate an index for pseudo-indexed-sequential access
.br
ospell - the script pipeline suggested in K&P for spelling errors
.sp 1 
.in 
DIAGNOSTICS
.br 
.in 7 
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- split            820  asc  30-oct-80 09:14:35  tools
.bp 
.rm 70 
.in 0 
.he 'SPLIT'1/11/79'SPLIT'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
split - split a file into pieces
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
split
[-n] [file [name] ]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Split
reads
file
and writes it in n-line pieces (default 1000),
as many as necessary, onto a set of output files.
The name of the output file is
name
with
aa
appended, and so on lexicographically.
If no output name is given,
x
is default.
 
If no input file is given, or if - is given in its stead, then the
standard input file is used.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The Unix command 'split'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if the input file could not be opened.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Debbie Scherrer
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- tee              605  asc  30-oct-80 09:14:35  tools
.bp 
.rm 70 
.in 0 
.he 'TEE'1/11/79'TEE'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
tee -  copy input to standard output and named files
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
tee
[file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Tee
copies the standard input to the standard output and makes copies in
the named files.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The tool 'cat'; the tool 'crt'; the Unix command 'tee'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if the input file cannot be opened.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Debbie Scherrer
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- tr              2583  asc  30-oct-80 09:14:36  tools
.pl 60 
.bp 
.in 0 
.rm 70 
.he 'TR'07/06/78'TR' 
.fo ''-#-'' 
.fi 
.in 7 
.ti -7 
NAME 
.br 
tr - character transliteration 
.sp 1 
.ti -7 
SYNOPSIS 
.br 
tr <infile >outfile from [to] 
.sp 1 
.ti -7 
DESCRIPTION 
.br 
"TR" copies the standard input to the standard output with 
substitution or deletion of selected characters.  Input 
characters found in "FROM" are mapped into the corresponding 
characters of "TO".
Ranges of characters may be specified by separating 
the extremes by a dash.
For example, a-z stands for the string of characters whose ascii
codes run from character a through character z.
 
If the number of characters 
in "FROM" is the same as in "TO", a one to one corresponding 
translation will be performed on all occurrences of the characters 
in "FROM".
If the number of characters in "FROM" is more than in "TO", the 
implication is that the last character in the "TO" string is 
to be replicated as often as necessary to make a string as long 
as the "FROM" string, and that this replicated character should 
be collapsed into only one.  If the "TO" string is missing or 
empty, "TR" will take this condition as a request to delete 
all occurrences of characters in the "FROM" string. 
.sp 1 
"TR" differs from the tool "CH" since it deals only with 
single characters or ranges of characters, while "CH" deals 
with character strings.  For example  tr xy yx  would change 
all x's into y's and all y's into x's, whereas ch xy yx 
change all the patterns "xy" into "yx". 
.sp 1 
One of the most common functions of "TR" is to translate 
upper case letters to lower case, and vice versa.  Thus, 
  
.ce 
tr A-Z a-z 
  
would map all upper case letters to lower 
case.
Users of systems which cannot pass
both upper and lower case characters on a command line 
should remember to include the appropriate escape flags.
.sp 1 
.ti -7 
FILES 
.br 
None 
.sp 1 
.ti -7 
SEE ALSO 
.br 
.nf 
Tools "find" and "ch". 
The "Software Tools" book, p.51-61. 
The "UNIX Programmer's Manual", p. TR(I). 
.fi 
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
"usage: translit from to." 
.br 
.in +5 
The command line passed to transit is in error. 
.br 
.in -5 
"from: too large." 
.br 
.in +5 
The string for "from" is too large.  Current limit is 100 characters 
including E0S. 
.br 
.in -5 
"to: too large." 
.br 
.in +5 
The string for "to" is too large.  Current limit is 100 characters 
including EOS. 
.sp 1 
.in -5 
.ti -7 
AUTHORS 
.br 
Original code from Kernighan and Plaugers's "Software Tools", 
with modifications by Debbie Scherrer. 
.sp 1 
.ti -7 
BUGS/DEFICIENCIES 
.br 
#-h- uniq             880  asc  30-oct-80 09:14:36  tools
.bp 
.rm 70 
.in 0 
.he 'UNIQ'1/11/79'UNIQ'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
uniq - strip adjacent repeated lines from a file
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
uniq [-c] [file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Uniq
reads the input file(s), comparing adjacent lines.
Second and succeeding copies of repeated lines are removed; the
remainder is written to standard output.
 
If the '-c' flag is given,
each line is preceded by a count of the number of occurrences of
that line.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
The tool 'comm'; the Unix command 'uniq'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if an input file cannot be opened and
processing is terminated.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Originally from Kernighan and Plauger's 'Software Tools', with
modifications by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- unrot            852  asc  30-oct-80 09:14:37  tools
.bp 
.rm 70 
.in 0 
.he 'UNROT'1/15/79'UNROT'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
unrot - unrotate lines rotated by kwic
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
unrot [-n] [file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Unrot
processes the rotated output of 'kwic' to generate a keyword-in-context
index.
 
The -n flag may be used to specify the width of the output lines.
The default is 80.
 
If no input files are given, or the filename '-' appears, lines will
be read from standard input.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
kwic; sort
.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 modifications
by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- wcnt             852  asc  30-oct-80 09:14:37  tools
.bp 
.rm 70 
.in 0 
.he 'WCNT'1/11/79'WCNT'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
wcnt - (character) word count
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
wcnt
[file ...]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Wcnt
counts (character) words in the named files, or in the standard input
if no name appears.
A word is a string of characters delimited by spaces, tabs, or newlines.
 
Wcnt
could also be implemented as a shell script file:
.ce
tr ' @t@n' '@n' | tr '!@n' | ccnt
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
lcnt; ccnt; the Unix command 'wc'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
A message is printed if an input file could not be opened; further
processing is terminated.
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Original from Kernighan and Plauger's 'Software Tools', with modifications
by Debbie Scherrer.
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- cd               542  asc  30-oct-80 09:14:38  tools
.in 7
.rm 70
.pl 62
.he /CD/%/CD/
.fo //-#-/
.bp
.ti -7
NAME
.sp
cd - change working directory
.sp
.ti -7
SYNOPSIS
.sp
cd directory
.sp
.ti -7
DESCRIPTION
.sp
cd
changes the working directory to
directory.
.sp
Since a new process is created to execute each command, cd would be
ineffective if it were written as a normal command.  It is therefore
recognized and executed by the shell.
.sp
The forms of the directory on RSX-11M is
.sp
.ce 4
/ddnn/ggg,mmm
/ggg,mmm
ddnn:[ggg,mmm]
[ggg,mmm]
.sp
.ti -7
SEE ALSO
.sp
pwd - print working directory
#-h- intro            644  asc  30-oct-80 09:14:38  tools
.bp 
.rm 70 
.in 0 
.he 'INTRO'1/11/79'INTRO'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
intro - list on-line documentation
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
intro
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Intro
lists the tools for which user documents are available.
These documents can then be accessed via the tool 'man'.
.sp 1
.in 
FILES 
.br 
.in 7 
Currently, this tool is implemented as a script file.
It accesses the archive file containing the user documentation.
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
man; the Unix tool 'help'
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
None
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Dennis Hall
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- msplit           974  asc  30-oct-80 09:14:39  tools
.in 5
.rm 75
.pl 60
.he 'MSPLIT'1/11/79'MSPLIT'
.fo //-#-/
.bp 1
NAME
.in +3

msplit
- utility for salvaging message files

.ti -3
SYNOPSIS

msplit <file [-v] [root]

.ti -3
DESCRIPTION

msplit
reads the standard input file, which presumably has more messages on
it than msg can handle, and splits it up into files which contain a
fixed number of messages.  The files created are named rootaa, rootab, ...,
where root defaults to "tmsg" if none is specified on the command line.  If
the -v (verbose) option is selected, then the name of each file is displayed
on ERROUT as it is created.  The user should immediately use msg on these
temporaries to place the messages in appropriate files.  In particular, the
input file to msplit should be overwritten, since it is too large already.

.ti -3
FILES
.sp
none
.sp
.ti -3
SEE ALSO
.sp
msg - the utility for reading and sorting one's mail
.sp
.ti -3
AUTHOR
.sp
msplit was written by Joe Sventek
.sp
.ti -3
BUGS/DEFICIENCIES
.br
#-h- msg             1723  asc  30-oct-80 09:14:39  tools
.in 5
.rm 75
.pl 60
.he 'MSG'1/11/79'MSG'
.fo //-#-/
.bp 1
NAME
.in +3

MSG
- utility for manipulating message files

.ti -3
SYNOPSIS

msg [-f[n]] [-p[n]] [file]

.ti -3
DESCRIPTION

MSG
is a message file editor.  The message files which it can work on are those
used by the utility SNDMSG, as well as files created by MSG.  There are two
files in a user's home directory which are used by SNDMSG and MSG - mymail
and mbox.  If MSG is invoked without a file argument, MSG will initially
read mymail.  mbox is the file where the messages from mymail are saved
by default.  The -f switch is used to change the number of fill characters
written to the terminal whenever a carriage-return,line-feed pair is
written.  The -p switch can be used to change the page size (number of
lines per screenful) for MSG to use when displaying long output.  The default
is 22 lines.

A primer is available, and may be had by the execution of the following shell
script:

% msgprim

This will cause a copy of the primer to be displayed on standard output.  In
order to obtain the test message file used in the primer, execution of the
following shell script:

% msgtest

will cause the test message file to be copied to standard output.  In order to
run the test yourself, the following shell commands should suffice

% msgtest >test.msg ; msg test.msg

.ti -3
FILES
.sp
mymail - messages sent using the SNDMSG utility reside here.
.br
mbox - default file for saving messages from mymail.
.br
one scratch file is used by MSG.
.sp
.ti -3
SEE ALSO
.sp
SNDMSG - the utility for sending mail to other users
.br
msplit - the utility for salvaging message files
.sp
.ti -3
AUTHOR
.sp
MSG was written by Joe Sventek
.sp
.ti -3
BUGS/DEFICIENCIES
.br
#-h- convrt           910  asc  30-oct-80 09:14:40  tools
.bp 
.rm 70 
.in 0 
.he 'CONVRT'6/26/80'CONVRT'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
convrt - convert pip listing files to LIST carriage control
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
convrt [<infile] [>outfile]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
Convrt reads the standard input file, converts records with embedded
carriage control, and copies them to standard output in LIST carriage
control.  This utility is handy for converting listing files created
by pip, dmp, flx, etc.  For example

% pip temp.=[1,1]/fu
.br
% convrt <temp >001001.lst

causes the full directory listing of [1,1] to be placed on 001001.lst
in a form that can be edited by edi or ed, or manipulated by any of
the software tools.
.sp 1
.in 
FILES 
.br 
.in 7 
None
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
None
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
None
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
.sp 1 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
None to date.
#-h- args            2157  asc  30-oct-80 09:14:42  tools
.in 5
.rm 75
.pl 60
.he 'ARGS'8/25/80'ARGS'
.fo //-#-/
.bp 1
NAME
.in +3

args - use standard input as arguments for command

.ti -3
SYNOPSIS

args [-v] tool [arguments]

.ti -3
DESCRIPTION

args reads the standard input file and concatenates the words found there
onto the arguments passed to args.  It then spawns the tool "tool" with
those arguments.  The first argument to args which does not start with a
"-" is taken to be the name of the tool to be invoked.  args uses the
same search path as the shell, and if "tool" is a script file, a copy
of the shell will be spawned reading that file for its commands.  The
optional -v argument causes args to display the final command line on
ERROUT before spawning the sub-process.

The most common use of args is as a form of argument explosion, as in the
following example:

.in +5
Suppose the user wishes to delete all files which have the string "tst"
somewhere in the filename.  This may be accomplished with the following
shell command line:
.sp
% ls tst | args rm -v
.sp
All of the files matching the pattern "tst" will be fed to args, which will
concatenate the names onto rm's command line.  rm will then be spawned, and
will print the name of each file as it is deleted.

.in -5
If the information found on standard input is so voluminous as to cause
the argument string to be too large, the command line is displayed on ERROUT
and the process is NOT spawned.  This prevents the user from being destroyed
by his/her indescretion.

.ti -3
FILES
.sp
none
.sp
.ti -3
SEE ALSO
.sp
sh - command line interpreter (for search path rules)
.sp
.ti -3
AUTHOR
.sp
args was written by Joe Sventek
.sp
.ti -3
BUGS/DEFICIENCIES
.sp
If the arguments to be passed to "tool" on the args command line are to
include io redirection, they must be escaped with an @ as in the following
example:
.sp
.in +5
% ls %a | args cat "@>alist"
.sp
.in -5
The redirections must be escaped, since args will open alist as it's standard
output, rather that handing the string >alist to cat.
It is also necessary to surround the escaped io redirection string in quotes,
since the shell does something special with @[<>?] strings.
.br
#-h- asplit          1768  asc  30-oct-80 09:14:43  tools
.in 5
.rm 75
.pl 60
.he 'ASPLIT'8/25/80'ASPLIT'
.fo //-#-/
.bp 1
NAME
.in +3

asplit - salvage garbaged archive files

.ti -3
SYNOPSIS

asplit <file [-tstring] [-v]

.ti -3
DESCRIPTION

asplit reads the standard input file, looking for lines beginning with the
archive header flag (#-h-).  Upon locating such a line, the next word after
the header is used to generate a file name, and all lines read up to the
next pseudo-header line are written onto that file.  When generating the
file name, only the characters found before a left parenthesis are used, if
one is found.  If the -t switch is used, the string appended to the -t is
appended to each file name before the file is opened, thus permitting
a fixed tag string to be formatted into the file name.  If the -v option
is specified, the name of each file is reported on ERROUT as it is opened.
Any lines found at the beginning of the file before the first pseudo-header
line is copied to standard output.

asplit is commonly used to salvage an archive which has been garbaged, or to
take a monster fortran source program file and break it up into subroutines.
A script file (breakup) may be found on the tools binary directory which will
cause each subprogram of the form "subroutine snarf" or "... function snarf" to
be placed on a file of the name "snarf.qq".  The only side effect of this
transformation is that the source will be in lower case, and may be remedied
by modifying the file breakup.

.ti -3
FILES

none

.ti -3
SEE ALSO

ar - file archiver: the -s switch does essentially the same thing as asplit,
except that it tries to rebuild the source file as a new archive, which does
not always work in pathological cases.

.ti -3
AUTHOR

asplit was written by Joe Sventek

.ti -3
BUGS/DEFICIENCIES
.br
#-h- fel              999  asc  30-oct-80 09:14:43  tools
.in 5
.rm 75
.pl 60
.he 'FEL'8/25/80'FEL'
.fo //-#-/
.bp 1
.in +3
.ti -3
NAME

fell - fell the process tree from the login shell

.ti -3
SYNOPSIS

.nf
^C
MCR>FEL<ESCAPE>
.fi

.ti -3
DESCRIPTION

fel fells the process tree hanging from the login shell.  After the invocation
of FEL, the user should see the termination messages of the subprocesses in
the tree, followed by the shell's prompt.  fel only works when the shell has
been invoked with a SHL mcr command.  If fel cannot find a shell with the
correct name, it reports this fact with an error message.  If the terminal is
currently operating in half duplex and the bottom process in the tree is
reading the terminal, the user may have to type an extra carriage return in
order to cause the tree to topple.  Using an escape as the terminator for the
FEL command eliminates an extra MCR prompt which garbages up the screen.

.ti -3
SEE ALSO

shl - installed MCR command for invoking the shell

.ti -3
AUTHOR

fel was written by Joe Sventek
.br
#-h- postmn           703  asc  30-oct-80 09:14:44  tools
.in 5
.rm 75
.pl 60
.he 'POSTMN'8/25/80'POSTMN'
.fo //-#-/
.bp 1
NAME
.in +3

postmn - report the presence of mail

.ti -3
SYNOPSIS

postmn

.ti -3
DESCRIPTION

postmn looks to see if the requestor has received any mail.  If so, it reports
that fact upon the standard output file with the comment "You have new mail".

.ti -3
FILES

Uses the file address in the mail directory to determine the user's home
directory.

.ti -3
SEE ALSO

.nf
mail - utility for sending mail
msg - utility for reading and filing mail
resolve - utility for querying the mail database about users
users - utility for listing valid mail users
.fi

.ti -3
AUTHOR

postmn was written by Joe Sventek

.ti -3
BUGS/DEFICIENCIES
.br
#-h- shl              784  asc  30-oct-80 09:14:44  tools
.in 5
.rm 75
.pl 60
.he 'SHL'8/25/80'SHL'
.fo //-#-/
.bp 1
.in +3
.ti -3
NAME

shl - MCR installed command for starting up shell


.ti -3
SYNOPSIS

>shl [sh args]

.ti -3
DESCRIPTION

shl is an installed MCR task which permits the user to start up the
software tools shell.  An invocation of SHL by the user results in the
spawning of a task ".SHTnn" running the sh.tsk image and given the
arguments that SHL has retrieved via a GETMCR call.  This procedure is
done to asure that the login shell running at a particular terminal is
names ".SHTnn", a fact necessary for the correct usage of the FEL task.

.ti -3
SEE ALSO

.nf
fel - task for felling login shell's process tree
sh - shell (for arguments which may be given to shl)
.fi

.ti -3
AUTHOR

shl was written by Joe Sventek
.br
#-h- users           1084  asc  30-oct-80 09:14:45  tools
.in 5
.rm 75
.pl 60
.he 'USERS'8/25/80'USERS'
.fo //-#-/
.bp 1
NAME
.in +3

users - list valid mail users

.ti -3
SYNOPSIS

users [-1]

.ti -3
DESCRIPTION

users lists the valid user name to which mail may be sent on the standard
output.  If the standard output has been redirected to a file or pipeline,
the names are listed one per line.  If the standard output is to a terminal,
then the names are listed in five columns across the terminal, sorted
alphabetically from left to right.  If single-column output is desired,
the -1 switch will force a single column to the terminal.  The output of
users may be edited and used
as a mailing list file for the utility sndmsg.

.ti -3
FILES

users uses the file "address" in the mail directory to obtain the names of
valid users of the mail system.

.ti -3
SEE ALSO

.nf
sndmsg - utility to send mail
msg - utility for reading and filing mail
postmn - utility to check for the existence of mail
resolve - utility to query information concering mail users
.fi

.ti -3
AUTHOR

users was written by Joe Sventek

.ti -3
BUGS/DEFICIENCIES
.br
#-h- dc              3883  asc  30-oct-80 09:14:45  tools
.bp 1
.in 0 
.he 'DC (1)'07/20/80'DC (1)'
.fo ''-#-'' 
.fi 
.in 3 
.ti -3 
NAME 
.br 
dc - desk calculator
.sp 1 
.ti -3 
SYNOPSIS 
.br 
dc [files ...]
.sp 1 
.ti -3 
DESCRIPTION 
.br 
DC evaluates integer expressions from the source files,
one expression per input line.
If no input files are given, or the filename '-' is specified,
dc reads from the standard input.
 
Ordinarily dc operates on decimal integer arithmetic expressions,
but the user may specify an input base and output base other
than decimal.
 
Expressions may be simple arithmetic expressions or
replacement expressions.
The values of simple expressions are 
written on standard output when they are evaluated.
Replacement expressions are used to hold temporary values, and are
not automatically printed.
 
A simple expression is a normal arithmetic expression using
numbers, variables, parentheses, and the following
operators, listed in order of precedence:
.in +5
.nf
+  -          unary plus and negation operators.  These may  
                          only appear at the start of a simple
                          expression or after a "("
 
**            exponentiation
 
*   /   %     multiply, divide, modulo (remainder)
 
+   -         add, subtract
 
== !=         relations - equals, not equal to,
>  >=         greater than, greater than or equal to,
<  <=         less than, less than or equal to
                       (!=, ^=, ~= all treated as "not equal")
 
!             unary logical not (also ~ and ^)
 
|   &         logical or, and
 
.in -5
.fi
The logical operators ! | & and the relational operators result in
the values 1 for true and 0 for false.
 
A replacement expression is:
.sp
.ce
name = simple expression
.sp
where 'name' is a character string of (virtually) any length,
starting with a letter and consisting of only letters and digits.
(The characters a-f should not be considered letters when operating
in hexadecimal mode.)
Variables are automatically declared when they first appear to 
the left of an "=" sign,
and they should not be used in a simple expression until they have
been declared.
 
Radix Control
.br
.in +5
Radix control is available in 2 ways:
.br
1) There are default radix values for both input and output which
may be changed by setting the predefined variables 'ibase'
(input base) and 'obase' (output base).  (Radix 10 is always
used to evaluate and/or print radix-defining expressions.)
For example,
.sp
.in +10
ibase = 2
.br
obase = 16
.in -10
.sp
would accept input in binary and print results in hexadecimal.
 
2)  The radix of individual numbers may be explicitly given by
following the number with an underscore character and then the
desired radix.
For example,
.sp
.ce
100_16
.sp
would specify the hex number 100 (256 in decimal).
.in -5
.sp
.ti -3
EXAMPLES
.br
.sp
.nf
.ti +15
10 + (-64 / 2**4)
.br
would print the answer "6"
.sp
.in +15
.nf
temp = 101_2
temp == 5
.fi
.in -15
would print the answer "1" (true)
 
.nf
.in +15
ibase = 16
obase = 2
1a + f
.in -15
.fi
would print the answer "101001"
.sp
.in +15
.nf
ibase = 16
numa = 100_10
numb = 100
numa + numb
.in -15
.fi
would print the answer "356"
.sp 1 
.ne 2
.ti -3 
FILES 
.br 
None 
.sp 1 
.ne 3
.ti -3 
SEE ALSO 
.br 
macro, the UNIX M4 macro package
.br
The UNIX tools dc and bc
.sp 1 
.ne 5
.ti -3 
DIAGNOSTICS 
.br 
.in +3
.ti -3
arith evaluation stack overflow
.br
arithmetic expressions have been nested too deeply.
The size of the stack is set by the MAXSTACK definition
in the source code.
 
.ti -3
number error
.br
an input number has a number/character bigger than the current
radix
.sp
.ne 2
.ti -3
expression error
.br
invalid arithmetic expression
.in -3
.sp 1 
.ti -3 
AUTHOR 
.br 
Philip H. Scherrer (Stanford U.)
.sp 1 
.ti -3 
BUGS/DEFICIENCIES 
.br 
Dc only works with integers
 
The maximum value allowed depends on the host machine and is the
largest Fortran integer
#-h- dspc             864  asc  30-oct-80 09:14:46  tools
.bp 1
.in 0
.he 'DSPC (1)'7/1/79'DSPC (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
dspc - display all characters in a file
.nf
.sp
.ti -3
SYNOPSIS
.br
dspc [files ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Dspc copies the named files to the standard output,
replacing control characters by "^c", where c is the ascii
character used to enter the control character when
depressing the "control" key on most terminals.
More precisely, c is the ascii character whose
value is 100 (octal) plus the value of the control
character.
.sp
Control characters are those ascii characters with
values between 0 and 31, inclusive.  Newline characters
are displayed as usual, however.
.sp
If no filenames are given, or the name '-' is specified,
show will read from the standard input.
.fi
.sp
.ne 2
.ti -3
SEE ALSO
.br
cat, page
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- fb              3001  asc  30-oct-80 09:14:47  tools
.bp 1
.in 0 
.he 'FB (1)'5/28/80'FB (1)'
.fo ''-#-'' 
.fi 
.in 7 
.ti -7 
NAME 
.br 
fb - search blocks of lines for text patterns
.sp 1 
.ti -7 
SYNOPSIS 
.br 
fb
[-acx] [-ln] [-sexpr [-sexpr]] expr [expr ...]
.sp 1 
.ti -7 
DESCRIPTION 
.br 
"Fb"
(find block) searches blocks or groups of lines in a file for
text patterns.
It is similar to 'find' except that if a pattern is found,
the entire block of lines is copied to standard output,
rather than simply the line in which the pattern occurred.
Thus it is useful for searching mailing lists, bibliographies,
and similar files where several lines are grouped together to
form cohesive units.
 
The search patterns may be any regular expression as described
in the 'ed' and 'find' writeups.
 
"Fb"
assumes the blocks of lines are separated by an empty line or a
line containing only blanks.
When "fb" is called without any options, standard input is read
and each line is checked to see if it matches any of the regular
expressions given as arguments.
If any matches are found,
the entire block is printed on standard output.
 
Other options include:
 
.in +10
.ti -8
-a      Only print the block if ALL the arguments are found within it
 
.ti -8
-x      Only print the block if none of the arguments are 
found within it
 
.ti -8
-c      Only print a COUNT of the number of blocks found which
match/don't match the expressions
 
.ti -8
-sexpr  Use 'expr' as the block separator (instead of a blank or
empty line).  "Expr" can be a regular expression just as
the search arguments can.
 
If two "-sexpr" arguments are given, the first one is considered
to be the pattern which starts a block (e.g. -ssubroutine) and
the second is considered the pattern which ends a block 
(e.g. -send).
 
.ti -8
-ln     prints only the first 'n' lines of the block;
if the block contains less than 'n' lines, the block is padded
out with blank lines.
.in -10
  
.fi 
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 
A scratch file ("fbt") is used if the internal line buffer
becomes full.
.sp 1 
.ti -7 
SEE ALSO 
.br 
find, ed
.br
For a complete description of regular expressions, see
"Software Tools" pages 135-154.
.sp 1 
.ti -7 
DIAGNOSTICS 
.br 
Error messages are given if:
.br
.in +3
a)  One of the patterns given is illegal
.br
b)  Too many separators are given (2 are allowed)
.br
c)  The maximum number of expressions is exceeded (9 are allowed)
.br
d)  There are problems opening the scratch file (when the block line
buffer fills up).
 
.in -3
If the following messages show up, something is dreadfully wrong:
.in +3
a)  "Illegal default separator"
.br
b)  "Block buffer overflow"
.in -3
.sp 1 
.ti -7
AUTHORS
.br
Debbie Scherrer (Lawrence Berkeley Laboratory)
.sp 1
.ti -7 
BUGS 
.br 
An expression may not start with a minus sign (-).

Regular expressions can not span line boundaries.
#-h- field           2216  asc  30-oct-80 09:14:48  tools
.bp 1
.in 0
.he 'FIELD (1)'7/10/80'FIELD (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
field - manipulate fields of data
.nf
.sp
.ti -3
SYNOPSIS
.br
field [-t[c] | fieldlist] outputformat [file ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
.fi
Feild
is used to manipulate data kept in formatted fields.
It selects data from certain fields of the input files 
and copies it to certain places in the standard output.
 
The 'fieldlist' parameter is used to describe the interesting
columns on the input file.
Fields are specified by naming the columns in which they
occur (e.g. 5-10) or the columns in which they start and
an indication of their length (e.g. 3+2, meaning a field
which starts in column 3 and spans 2 columns).
When specifying more than one field, separate the specs
with commas (e.g. 5-10,16,72+8)
Fields may overlap, and need not be in ascending numerical order
(e.g. 1-25,10,3 is OK).
 
If input fields do not fall in certain columns, but rather are
separated by some character (such as a blank or a comma), 
describe the fields by using the '-tc' flag, replacing 'c'
with the appropriate
separator (a tab character is the default).
 
Once fields have been described with either the '-tc' flag
or a fieldlist, they can be arranged on output by
the 'outputformat' argument.
This argument is actually a picture of what the output line
should look like.
Fields from input are referred to as $1, $2, $3, etc., referring
to the first, second, third, etc. fields that were specified.
(Up to 9 fields are allowed, plus the argument $0 which
refers to the whole line.)
These $n symbols are placed in the output format wherever 
that field should appear, surrounded by whatever characters
desired.
For example, an outputformat of:
.ce
           "$2 somewords $1"
would produce an output line such as:
.ce
            field2 somewords field1
 
If no input files are specified, or if the filename '-' is
found, field will read from the standard input.
.sp
.ti -3
DIAGNOSTICS
.br
illegal field specification
.in +5
The fieldlist specification was in error, probably because
it contained letters or some other
illegal characters
.in -5
.sp
.ti -3
SEE ALSO
.br
sedit
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- lam             1853  asc  30-oct-80 09:14:49  tools
.bp 1
.in 0
.he 'LAM (1)'7/30/79'LAM (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
lam - laminate files
.nf
.sp
.ti -3
SYNOPSIS
.br
lam -string | files...
.fi
.sp
.ti -3
DESCRIPTION
.br
Lam laminates the named files to the standard output.
That is, the first output line is the result of concatenating
the first lines of each file, and so on.
If the files are different lengths, null lines are used for the missing
lines in the shorter files.
.sp
The "-string" arguments are used to place strings in each output
line.  Each "string" is placed in the output lines at the point
it appears in the argument list.  For example,
.sp
.in +3
.nf
lam -file1: foo1 "-, file2:" foo2
.in -3
.sp
.fi
results in output lines that look like
.sp
.in +3
.nf
file1: a line from foo1, file2: a line from foo2
.in -3
.sp
.fi
The escape sequences described in find (and change)
are valid in "string"
arguments.  Thus
.sp
.in +3
.nf
lam foo1 -@n foo2
.in -3
.sp
.fi
results in the lines from foo1 and foo2 being interleaved.
.sp
Files and string specifications may appear in any order in the
argument list.
.sp
If no file arguments are given,
or if the file "-" is specified,
lam reads the standard input.
.fi
.sp
.ti -3
FILES
.br
None
.sp
.ne 2
.ti -3
SEE ALSO
.br
comm, tail
.fi
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
too many arguments
.br
.in +3
The maximum number of command line arguments allowed has been exceeded.
It is set by the MAXARGS definition in the source code.
.in -3
.sp
too many strings
.br
.in +3
The max number of characters in a string has been exceeded.
It is set by the MAXBUF definition in the source code.
.in -3
.sp
output buffer exceeded
.in +3
The size of the output line buffer has been exceeded. 
It is set by the MAXOBUF definition in the source code.
.in -3
.sp
.ne 2
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
.sp
.ti -3
BUGS/DEFICIENCES
#-h- ll               609  asc  30-oct-80 09:14:49  tools
.bp 1
.in 0
.he 'LL (1)'9/15/78'LL (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
ll - print line lengths
.nf
.sp
.ti -3
SYNOPSIS
.br
ll files...
.fi
.sp
.ti -3
DESCRIPTION
.br
Ll prints the lengths of the shortest and longest lines
in the named files.  The name "-" may be used
to refer to the standard input.  If no files
are given, ll reads the standard input.
 
NEWLINE characters are not counted as part of the length of a
line.
.fi
.sp
.ti -3
FILES
.br
None
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
A message is issued if a named file could not be opened.
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- mcol            2352  asc  30-oct-80 09:14:50  tools
.bp 1
.in 0
.he 'MCOL (1)'10/1/78'MCOL (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
mcol - multicolumn formatting
.nf
.sp
.ti -3
SYNOPSIS
.br
mcol [-cn] [-ln] [-wn] [-gn] [-dn] [file ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Mcol reads the named files and formats them into multicolumn
output on the standard output.
If the filename "-" is given, or no files are specified, the
standard input is read.
 
The options are as follows.
.sp
.in +5
.ti -5
-cn  Format the output into "n" columns.  Default is 2.
.sp
.ti -5
-ln  Set the output page size to "n".  Mcol produces its output
in pages, but does not place separators between the pages on
the assumption that some subsequent processor will do that.
(The default page length is 55.)
.sp
.ti -5
-wn  Set the column width to "n" characters.  Lines longer than "n"
characters are truncated.
(The default column width is 60.)
.sp
.ti -5
-gn  Set the "gutter" width to "n".  The gutter is the white space
between columns.
(The default gutter width is 8.)
.sp
.ti -5
-dn  Assume output is to be printed on a display terminal.  The
column size is set to "n" characters and the page size is set to
24 lines.  The number of columns and gutter width are computed
to maximize the amount of information on a single screen.
If "n" is omitted, 10 is used, which is useful for displaying
lists of file names.
.sp
.in -5
.fi
.sp
.ti -3
FILES
.br
None
.sp
.ti -3
SEE ALSO
.br
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
.nf
invalid column count
invalid page size
invalid column width
invalid gutter width
.br
.fi
.in +3
The value of one of the option flags is invalid or exceeds
the limitations of mcol.
.sp
.ti -3
ignoring invalid flag
.br
A command argument option flag was given which mcol didn't recognize.
.in -3
.sp
insufficient buffer space
.br
.in +3
Mcol could not buffer an entire page.  This is usually the result
of options that specify a large page size or many columns.
The buffer size is set by the MAXBUF definition in the source code.
.in -3
.sp
too many lines
.in +3
.br
The number of lines per page times the number of columns
exceeded mcol's line buffer space.
The maximum number of lines allowed is set by the MAXPTR definition
in the source code.
.in -3
.fi
.sp
.ne 2
.ti -3
BUGS/DEFICIENCIES
.br
.sp
.ti -3
AUTHORS
.br
Original by David Hanson and friends (U. of Arizona), with
modifications by Debbie Scherrer (LBL).
#-h- pl              1754  asc  30-oct-80 09:14:51  tools
.bp 1
.in 0
.he 'PL (1)'9/18/79'PL (1)
.sp 2
.in +3
.fi
.ti -3
NAME
.br
pl - print specified lines/pages in a file
.nf
.sp
.ti -3
SYNOPSIS
.br
pl [-pn] numbers [file ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Pl
prints the specified lines from each of the named files
on the standard output.  If no files are given, or if
the name "-" is specified, pl reads the standard input.
.sp
The "numbers" argument is a list of line numbers
separated by commas, e.g.
.sp
.in +3
.nf
pl 4,5,26,55 foo bazrat
.in -3
.sp
.fi
prints lines 4, 5, 26, and 55 in file "foo" and
"bazrat".  The line
numbers may be given in any order.
Repeated numbers cause the specified lines to be
printed once for each occurrence of the line number.
Line number ranges can also be given, e.g. 4-15.
.sp
The "-p" option causes pl to print pages instead of lines,
and the numbers refer to page numbers.  If an integer follows
the "-p", it is taken as the page size; the default is 23.
Repeated numbers cause the specified pages to be printed
once for each occurrence of the page number.
.fi
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
bad page size
.in +5
Invalid page size specified after '-p' flag
.in -5
bad number
.in +5
Invalid number given as argument
.in -5
bad range
.in +5
Invalid range given as argument
.in -5
too many numbers
.in +5
Number of lines/pages specified overflowed the buffer.  
Maximum number of lines is determined by the MAXLINES definition
in the source code.
.in -5
ignoring invalid argument
.in +5
An invalid flag was specified.   Processing continues.
.in -5
.fi
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
.sp
.ti -3
BUGS/DEFICIENCIES
.br
There is a limit to the size of pages which can be buffered.
This is set by the MAXBUF definition in the source code.
#-h- pr              1211  asc  30-oct-80 09:14:51  tools
.bp 1
.in 0
.he 'PR (1)'1/15/77'PR (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
print - paginate files to standard output
.nf
.sp
.ti -3
SYNOPSIS
.br
pr [-ln] [file ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Pr
paginates the named files to standard output.
Each file is printed as a sequence of pages.  Each page
is 66 lines
long, including a 6-line header and 3-line footer.
The header includes the file name, possibly the date, and
the page number.
 
If the file '-' is specified, or no file names are given,
the standard input is read.
 
Option flags include:
.in +11
.ti -5
-ln   Sets the page length to 'n'.
Default page length is 66.
.in -11
.sp
.fi
.ne 2
.ti -3
SEE ALSO
.br
os, detab, mcol, format, cat
.sp
.ti -3
DIAGNOSTICS
.br
ignoring invalid argument
.in +3
An option flag was specified which pr did not understand
 
.in -3
A message is printed if an input file could not be opened
.sp
.ti -3
AUTHORS
.br
Original from the Kernighan-Plauger 'Software Tools' book,
with modifications by David Hanson and friends (U. of Arizona)
and Debbie Scherrer (LBL)
.sp
.ti -3
BUGS/DEFICIENCES
.br
The header and trailer spacing can be modified by adjusting the 
MARGIN1, MARGIN2, and
BMARGIN definitions in the source code.
#-h- rev              432  asc  30-oct-80 09:14:52  tools
.bp 1
.in 0
.he 'REV (1)'7/11/79'REV (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
rev - reverse lines
.nf
.sp
.ti -3
SYNOPSIS
.br
rev [files ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Rev copies the named files to the standard output,
reversing the order of the characters in every
line.
 
If no files are given, or the filename '-' is specified,
rev reads from the standard input.
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- sedit           4995  asc  30-oct-80 09:14:53  tools
.bp 1
.in 0
.he 'SEDIT (1)'11/30/79'SEDIT (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
sedit - stream editor
.nf
.sp
.ti -3
SYNOPSIS
.br
sedit [-n] {[-e script | -f sfile]... | script} [file]...
.fi
.sp
.ti -3
DESCRIPTION
.br
Sedit
copies the named input
files
to the standard output, performing
editing as directed by sedit commands in "script" or
in "sfile".
The -e
flag indicates that the next argument is
to be interpreted as an sedit command (see below).
The -f
flag indicates that the next argument is the name of a file
in which
sedit commands appear one per line.
The
-e and -f
arguments may be intermixed in any order.
The order of command
execution
is the order in which commands are read.
If no
-e or -f
flags are given, the first argument is used as an sedit command.
Normally, sedit writes each line of input to the output after editing;
the -n option suppresses this action.  As a result, the only output
is that resulting from sedit commands.
.sp
When the first argument not in the scope of a flag is encountered,
it and all succeeding arguments are taken as input files.
If no files are given, or if the name "-" is specified, the
standard input is read.
.sp
Sedit commands
have the general form
.sp
.in +3
.nf
line1 [, line2] command arguments
.in -3
.sp
.fi
A line number (line1 or line2) is either a decimal number
that refers to a specific input line (input lines
are counted cumulatively across files), a "$" that
refers to the last line of input,
or a /pattern/ where pattern is a regular expression (as in edit).
Line number 0 may be used to specify commands that should be
executed before any input is read.
.sp
A command with no line numbers
is applied to every line of input.
A command with one line number
is applied to every line of input that matches the line number.
A command with two line numbers
is applied to every line of input beginning with the first line
that matches line1 through the next line that
matches line2.  Thereafter, the process is repeated, looking again
for a line that matches line1.
.sp
Sedit accepts the following commands.  Each command may be
used with 0, 1, or 2 line numbers.
The a, c, and i commands may not appear in command line scripts.
.sp
.nf
.cc +
a
<text>
.
+cc .
.fi
.in +3
Append.  The <text> is placed on the output after each selected
line.  The <text> does not change the line number nor is it subject
to subsequent sedit commands.
.in -3
.sp
.ne 5
.nf
.cc +
c
<text>
.
+cc .
.fi
.in +3
Change.  The selected lines are deleted and
<text> is placed on the output in their place.
The <text> does not change the line number nor is it subject
to subsequent sedit commands.
.in -3
.sp
d
.in +3
Delete.  The selected lines are deleted.
.in -3
.sp
.nf
.cc +
i
<text>
.
+cc .
.fi
.in +3
Insert.  The <text> is placed on the output before each selected
line.  The <text> does not change the line number nor is it subject
to subsequent sedit commands.
.in -3
.sp
p
.in +3
Print.  The selected lines are printed on the standard output.
.in -3
.sp
r file
.in +3
Read file.  The contents of "file" are placed on the output after
each selected line exactly as if the contents 
were given as <text> in an
a command.  The new lines
do not change the line number nor are they subject
to subsequent sedit commands.
.in -3
.sp
s/pat/new/gp
.in +3
Substitute.  The leftmost
occurrences of pat in the selected lines is changed to new.
If g is specified, all occurrences are changed.  If p is
specified, the resulting line is printed.
.in -3
.sp
w file
.in +3
Write file.  The selected lines are appended to "file".  Files
mentioned in w commands are created before processing begins.
The limit on the number of w commands depends on the number
of files that can be opened at the same time.
.in -3
.sp
=
.in +3
Print line number.  The current line number is printed
on the output as a line.
.in -3
.sp
Text appended by a, c, or r commands is placed on the output in
the same order as the execution of the commands.
Similar comments apply to text inserted by i commands.
.sp
Sedit
can accomodate commands totaling approximately 5000 characters
(including <text> arguments), and lines up to 120 characters in length.
.fi
.sp
.ne 2
.ti -3
SEE ALSO
.br
edit, change, find, tr
.fi
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
In addition to the usual error messages resulting from file access
failure, sedit issues the following messages preceeding by the
offending command line.
.sp
bad line numbers
.in +3
indicates that the line number expressions are invalid.
.in -3
.sp
invalid command
.in +3
indicates that the command preceeding the message is illegal.
This message is issued for a, i, or c commands if they appear
in command string scripts.
.in -3
.sp
too many commands
.in +3
indicates exhaustion of space to hold commands.
The size of the command buffer is determined by the MAXBUF definition
in the source code.
.in -3
.sp
.ti -3
AUTHOR
.br
Chris Fraser (U. of Arizona)
.sp
.ti -3
BUGS/DEFICIENCIES
.br
The '$' indicator for end-of-file doesn't always work.
#-h- tail             805  asc  30-oct-80 09:14:54  tools
.bp 1
.in 0
.he 'TAIL (1)'8/26/79'TAIL (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
tail - print last lines of a file
.nf
.sp
.ti -3
SYNOPSIS
.br
tail [-n] [file....]
.fi
.sp
.ti -3
DESCRIPTION
.br
Tail
prints the last "n" lines of the indicated file.
If 'n' is omitted, the last 23 lines are printed.
 
If "file" is omitted or is "-", tail reads the standard input.
.sp
.ti -3
SEE ALSO
.br
split
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
.sp
.ti -3
BUGS/DEFICIENCIES
.br
An internal buffer of MAXBUF characters is kept.
If the value of "n" would require buffering more characters than
the buffer can hold,
tail
prints the last MAXBUF characters of the file.
In this case, the first line of output may not be an entire line.
MAXBUF is a definition in the source code which may be adjusted.
#-h- tsort           1742  asc  30-oct-80 09:14:54  tools
.bp 1
.in 0
.he 'TSORT (1)'10/1/78'TSORT (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
tsort - topologically sort symbols
.nf
.sp
.ti -3
SYNOPSIS
.br
tsort [files ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Tsort
topologically sorts the symbols in the named files.
If no files are specified, or the filename '-' is given,
tsort reads the standard input.
 
A symbol is considered any string of characters delimited
by blanks or tabs.
 
Each line of the input is assumed to be of the form
.sp
.in +3
.nf
a b c ...
.in -3
.sp
.fi
which states that
a
precedes
b, a
precedes
c,
and so on.
Note that there is nothing implied about the ordering of
b
and
c.
A line consisting of a single symbol simply "declares"
that symbol without specifying any ordering relations about it.
The output is a topologically sorted
list of symbols, one per line.
.sp
.fi
For example, suppose you have trouble getting up in the morning
because you can't quite remember what actions have to be
performed in which order.
However, you do know that the first action in the following
list precedes all others on the line:
 
.in +5
.nf
set_alarm   turn_off_alarm
wake_up    get_out_of_bed    turn_off_alarm
set_alarm     wake_up
.in -5
.fi
 
Using tsort to sort the above list would produce the following
set of actions for getting out of bed:
 
.in +5
.nf
set_alarm
wake_up
turn_off_alarm
get_out_of_bed
.fi
.in -5
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
circular
.br
.in +3
The input specifies a graph that contains at least one cycle.
.in -3
.sp
out of storage
.br
.in +3
The input is too large.
The size of tsort's buffer is determined by the MAXBUF
definition in the source code.
.in -3
.sp 
.ne 2
.ti -3
SEE ALSO
.br
sort
.ne 3
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- wc               913  asc  30-oct-80 09:14:55  tools
.bp 1
.in 0
.he 'WC (1)'2/15/79'WC (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
wc - count lines, words, and characters in files
.nf
.sp
.ti -3
SYNOPSIS
.br
wc [-lwc] files...
.fi
.sp
.ti -3
DESCRIPTION
.br
Wc prints the number of lines, words, and characters in the named
files.
The filename "-" specifies the standard input.
A total is also printed.  A "word" is any sequence of characters
delimited by white space.
.sp
The options -l, -w, and -c specify, respectively, that only the line,
word, or character count be printed.  For example,
.sp
.in +3
.nf
wc -lc foo
.in -3
.sp
.fi
prints the number of lines and characters in "foo".
.sp
If no files are given, wc reads its standard input and the total
count is suppressed.
.fi
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
name: can't open
.in +5
Printed when an input file can't be opened; processing ceases
.in -5
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
#-h- xref            1297  asc  30-oct-80 09:14:56  tools
.bp 1
.in 0
.he 'XREF (1)'1/1/79'XREF (1)'
.sp 2
.in +3
.fi
.ti -3
NAME
.br
xref - make a cross reference of symbols
.nf
.sp
.ti -3
SYNOPSIS
.br
xref [-f] [files ...]
.fi
.sp
.ti -3
DESCRIPTION
.br
Xref
produces a cross-reference
list of the symbols in each of the named files
on the standard output.
Each symbol is listed followed by the numbers of the lines
in which it appears.
If no files are given,
or the file "-" is specified, xref reads the standard input.
.sp
A symbol is defined as a string of letters, digits, underlines,
or periods that begins with a letter.
Symbols exceeding an internal limit are truncated.
This limit is determined by the MAXTOK definition in
the source code, and is currently set to 15.
.sp
Normally, xref treats upper- and lower-case letters as different
characters.  The -f option causes all letters to be folded to
lower-case.
.fi
.sp
.ne 2
.ti -3
DIAGNOSTICS
.br
out of storage
.br
.in +3
The file contains too many symbols or references to fit
within the current limitations of xref.
The size of the buffer is determined by the MAXBUF definition
in the source code.
.in -3
.fi
.sp
.ti -3
AUTHORS
.br
David Hanson and friends (U. of Arizona)
.sp
.ne 2
.ti -3
BUGS/DEFICIENCIES
.br
There should be a means of suppressing "junk" symbols such
as "the", "a", etc.
#-h- sndmsg          1877  asc  30-oct-80 09:14:56  tools
.in 5
.rm 75
.pl 60
.he 'SNDMSG'10/28/80'SNDMSG'
.fo //-#-/
.bp 1
NAME
.in +3

SNDMSG - utility for sending mail to other users

.ti -3
SYNOPSIS

sndmsg

.ti -3
DESCRIPTION

SNDMSG is the utility used to send mail to other users of the mail system.
The user is prompted for all of the necessary input in the following manner:
.sp
.in +5
.ti -3
1. The list of To addresses.
.ti -3
2. The list of Cc (carbon copy) addresses
.ti -3
3. The subject of the message
.ti -3
4. The body of the message
.sp
.in -5
The responses to the To and Cc prompts consist of user-names separated
by commas.  If it is necessary to continue the list of addresses onto another
line, a comma typed at the end of the line causes SNDMSG to prompt for another
line of addresses.  If the string `all' is typed as an address, all
users of the mail system will receive a copy of the message.  If the address
consists of `<name', a file `name' will be opened and its contents used
as a mailing list.  The structure of mailing list files differs from the
address lists (a feature soon to be removed).  The mailing list files
should consist of names separated by blanks or tabs.  A # symbol signals the
start of a comment in the mailing list file, and the rest of the line is
ignored.
.sp
The subject field may be a string of any length and content.  The user is
prompted concerning use of the text editor ed to compose the body of the
message.  If the editor is not used, everything typed up to an end-of-file
on the standard input is taken as the body of the message.  In this mode,
a line consisting of
.sp
q
.sp
will cause the sndmsg session to be terminated, with no messages sent.
.sp
.ti -3
FILES
.sp
three scratch files are used by SNDMSG.
.sp
.ti -3
SEE ALSO
.sp
MSG - the message editor
.br
ED - the text editor
.sp
.ti -3
AUTHOR
.sp
SNDMSG was written by Joe Sventek
.sp
.ti -3
BUGS/DEFICIENCIES
.br
#-h- alist            862  asc  30-oct-80 09:15:01  tools
.bp 
.rm 70 
.in 0 
.he 'ALIST'1/11/79'ALIST'
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
alist - generate paginated listing of source archive
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
alist file ...
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
alist generates a paginated listing of archive files.  A table of contents
with the relative page number in the listing is displayed first, with
each element of the archive file starting on a new page.  alist considers
each line which starts with the string "#-h-" to be the beginning of a
new entry, so that nested archives will be handled reasonably.
The listing is displayed on standard output, and may be piped into lpr
to queue to the printer.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
pr - print files
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- isam            1088  asc  30-oct-80 09:15:03  tools
.bp 
.rm 70 
.in 0 
.he :ISAM:10/29/80:ISAM:
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
isam - generate index for pseudo-indexed-sequential access
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
isam [-d<dif>] [-w<width>] [-j<l/r>]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
isam is used to generate an index for a text file such that the index may
be used later to permit indexed-sequential access to the file.
isam reads every `dif'th line (default is 1) from the standard input,
noting its disk address with
a call to markl.  It uses getwrd to retrieve the first "word" from the line
and uses this as the primary key to the record.  This key is then output
to standard output in a field `width' wide (default is 25) and justified
according to the -j switch (default left).  The two-word address from
markl is then output as decimal integers before the index record is
flushed.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
spell - spelling error finder; uses an isam-generated index
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- ruler            702  asc  30-oct-80 09:15:04  tools
.bp 
.rm 70 
.in 0 
.he ;RULER;10/29/80;RULER;
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
ruler - display ruler on terminal screen
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
ruler [n]
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
ruler displays a ruler on the terminal.  This is especially useful when
using field or other utilities which require knowledge of the column
positions of portions of the screen.  The optional numeric argument
indicates how many columns to format in the ruler.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
field - utility for field manipulation
.br
sort - file sorter
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- pack             719  asc  30-oct-80 09:15:05  tools
.bp 
.rm 70 
.in 0 
.he ;PACK;10/29/80;PACK;
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
pack - pack words into columns
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
pack
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
pack takes the words (groups of characters separated by blanks or tabs)
found on the standard input and outputs them to standard output in five
columns, 16 spaces wide, ordered from left to right.  The characters
used to achieve the separation of columns are TAB characters, such that
those terminals which support hardware tabs can be driven efficiently.
.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 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
#-h- malfix           909  asc  30-oct-80 09:15:06  tools
.bp 
.rm 70 
.in 0 
.he ;MALFIX;10/29/80;MALFIX;
.fo ''-#-' 
.fi 
NAME 
.br 
.in 7 
malfix - fix up old mail files for MSG
.sp 1 
.in 
SYNOPSIS 
.br 
.in 7 
malfix <infile >outfile
.sp 1 
.in 
DESCRIPTION 
.br 
.in 7 
malfix exists solely to convert mail files created with the old software
tools mail utility into the format necessary for MSG.
The suggested scenario for fixing up your mbox file (the place where MAIL
used to save your mail) is as follows:
.sp
.in +5
.nf
cat mymail >>mbox
cat ~bin/mymail >mymail
rename mbox. ombox.
malfix <ombox >mbox
.fi
.sp
.in -5
Now run MSG on the mbox file to make sure everything went OK (of course it
did, but let's be safe.)  Then the ombox file may be deleted.
.sp 1
.in 
FILES 
.br 
.in 7 
.sp 1 
.in 
SEE ALSO 
.br 
.in 7 
msg - message file editor
.sp 1 
.in 
DIAGNOSTICS 
.br 
.in 7 
.sp 1 
.in 
AUTHORS 
.br 
.in 7 
Joe Sventek
.sp 1 
.in 
BUGS 
.br 
.in 7 
