Added man pages.

This commit is contained in:
Ben Gras 2005-05-02 13:01:42 +00:00
parent 89ac678b9b
commit 141fe2c6e0
368 changed files with 50911 additions and 0 deletions

16
man/Makefile Normal file
View file

@ -0,0 +1,16 @@
MAN=/usr/man
all::
clean::
install::
-rm -rf $(MAN)
mkdir $(MAN)
tar cf - `find . -name '*.[0-9]'` | (cd $(MAN) && tar xf -)
chown -R bin /usr/man
chgrp -R operator /usr/man
find /usr/man -type f | xargs chmod 644
find /usr/man -type d | xargs chmod 755
makewhatis $(MAN)

35
man/man1/M.1 Normal file
View file

@ -0,0 +1,35 @@
.TH M 1
.SH NAME
M, U \- conveniently mount and unmount
.SH SYNOPSIS
\fBM \fIdevice\fR [\fB\-r\fR]\fR
.br
\fBU \fIdevice\fR\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-r" "Mount read-only"
.SH EXAMPLES
.EX "M root" "Mount the RAM image on /root"
.EX "M 0" "Mount /dev/fd0 on /fd0"
.EX "U fd1" "Unmount /dev/fd1 from /fd1"
.SH DESCRIPTION
.PP
\fIM\fR and \fIU\fR allow easy mounting and unmounting of a device by using
only an abbreviated device name or keyword. Special keywords are
\fBroot\fR, \fBtmp\fR, and \fBusr\fR for the three hard disk partitions
Minix runs in. Floppy devices are mounted on \fB/fd0\fR or \fB/fd1\fR. You
can use \fB0\fR and \fB1\fR instead of \fBfd0\fR and \fBfd1\fP. A device it
doesn't know about is mounted on \fB/mnt\fR.
.SH "SEE ALSO"
.BR mount (1),
.BR umount (1).

860
man/man1/acd.1 Normal file
View file

@ -0,0 +1,860 @@
.TH ACD 1
.SH NAME
acd \- a compiler driver
.SH SYNOPSIS
.B acd
\fB\-v\fR[\fIn\fR]
\fB\-vn\fR[\fIn\fR]
.BI \-name " name"
.BI \-descr " descr"
.BI \-T " dir"
.RI [ arg " ...]"
.SH DESCRIPTION
.de SP
.if t .sp 0.4
.if n .sp
..
.B Acd
is a compiler driver, a program that calls the several passes that are needed
to compile a source file. It keeps track of all the temporary files used
between the passes. It also defines the interface of the compiler, the
options the user gets to see.
.PP
This text only describes
.B acd
itself, it says nothing about the different options the C-compiler accepts.
(It has nothing to do with any language, other than being a tool to give
a compiler a user interface.)
.SH OPTIONS
.B Acd
itself takes five options:
.TP
\fB\-v\fR[\fIn\fR]
Sets the diagnostic level to
.I n
(by default
.BR 2 ).
The higher
.I n
is, the more output
.B acd
generates:
.B \-v0
does not produce any output.
.B \-v1
prints the basenames of the programs called.
.B \-v2
prints names and arguments of the programs called.
.B \-v3
shows the commands executed from the description file too.
.B \-v4
shows the program read from the description file too. Levels 3 and 4 use
backspace overstrikes that look good when viewing the output with a smart
pager.
.TP
\fB\-vn\fR[\fIn\fR]
Like
.B \-v
except that no command is executed. The driver is just play-acting.
.TP
.BI \-name " name"
.B Acd
is normally linked to the name the compiler is to be called with by the
user. The basename of this, say
.BR cc ,
is the call name of the driver. It plays a role in selecting the proper
description file. With the
.B \-name
option one can change this.
.B Acd \-name cc
has the same effect as calling the program as
.BR cc .
.TP
.BI \-descr " descr"
Allows one to choose the pass description file of the driver. By default
.I descr
is the same as
.IR name ,
the call name of the program. If
.I descr
doesn't start with
.BR / ,
.BR ./ ,
or
.BR ../
then the file
.BI /usr/lib/ descr /descr
will be used for the description, otherwise
.I descr
itself. Thus
.B cc \-descr newcc
calls the C-compiler with a different description file without changing the
call name. Finally, if
.I descr
is \fB"\-"\fP, standard input is read. (The default lib directory
.BR /usr/lib ,
may be changed to
.I dir
at compile time by \fB\-DLIB=\e"\fP\fIdir\fP\fB\e"\fP. The default
.I descr
may be set with \fB\-DDESCR=\e"\fP\fIdescr\fP\fB\e"\fP for simple
installations on a system without symlinks.)
.TP
.BI \-T " dir"
Temporary files are made in
.B /tmp
by default, which may be overridden by the environment variable
.BR TMPDIR ,
which may be overridden by the
.B \-T
option.
.SH "THE DESCRIPTION FILE"
The description file is a program interpreted by the driver. It has variables,
lists of files, argument parsing commands, and rules for transforming input
files.
.SS Syntax
There are four simple objects:
.PP
.RS
Words, Substitutions, Letters, and Operators.
.RE
.PP
And there are two ways to group objects:
.PP
.RS
Lists, forming sequences of anything but letters,
.SP
Strings, forming sequences of anything but Words and Operators.
.RE
.PP
Each object has the following syntax:
.IP Words
They are sequences of characters, like
.BR cc ,
.BR \-I/usr/include ,
.BR /lib/cpp .
No whitespace and no special characters. The backslash character
.RB ( \e )
may be used to make special characters common, except whitespace. A backslash
followed by whitespace is completely removed from the input. The sequence
.B \en
is changed to a newline.
.IP Substitutions
A substitution (henceforth called 'subst') is formed with a
.BR $ ,
e.g.
.BR $opt ,
.BR $PATH ,
.BR ${lib} ,
.BR $\(** .
The variable name after the
.B $
is made of letters, digits and underscores, or any sequence of characters
between parentheses or braces, or a single other character. A subst indicates
that the value of the named variable must be substituted in the list or string
when fully evaluated.
.IP Letters
Letters are the single characters that would make up a word.
.IP Operators
The characters
.BR = ,
.BR + ,
.BR \- ,
.BR \(** ,
.BR < ,
and
.B >
are the operators. The first four must be surrounded by whitespace if they
are to be seen as special (they are often used in arguments). The last two
are always special.
.IP Lists
One line of objects in the description file forms a list. Put parentheses
around it and you have a sublist. The values of variables are lists.
.IP Strings
Anything that is not yet a word is a string. All it needs is that the substs
in it are evaluated, e.g.
.BR $LIBPATH/lib$key.a .
A single subst doesn't make a string, it expands to a list. You need at
least one letter or other subst next to it. Strings (and words) may also
be formed by enclosing them in double quotes. Only
.B \e
and
.B $
keep their special meaning within quotes.
.SS Evaluation
One thing has to be carefully understood: Substitutions are delayed until
the last possible moment, and description files make heavy use of this.
Only if a subst is tainted, either because its variable is declared local, or
because a subst in its variable's value is tainted, is it immediately
substituted. So if a list is assigned to a variable then this list is only
checked for tainted substs. Those substs are replaced by the value
of their variable. This is called partial evaluation.
.PP
Full evaluation expands all substs, the list is flattened, i.e. all
parentheses are removed from sublists.
.PP
Implosive evaluation is the last that has to be done to a list before it
can be used as a command to execute. The substs within a string have been
evaluated to lists after full expansion, but a string must be turned into
a single word, not a list. To make this happen, a string is first exploded
to all possible combinations of words choosing one member of the lists within
the string. These words are tried one by one to see if they exist as a
file. The first one that exists is taken, if none exists than the first
choice is used. As an example, assume
.B LIBPATH
equals
.BR "(/lib /usr/lib)" ,
.B key
is
.B (c)
and
.B key
happens to be local. Then we have:
.PP
.RS
\fB"$LIBPATH/lib$key.a"\fP
.RE
.PP
before evaluation,
.PP
.RS
\fB"$LIBPATH/lib(c).a"\fP
.RE
.PP
after partial evaluation,
.PP
.RS
\fB"(/lib/libc.a /usr/lib/libc.a)"\fP
.RE
.PP
after full evaluation, and finally
.PP
.RS
.B /usr/lib/libc.a
.RE
.PP
after implosion, if the file exists.
.SS Operators
The operators modify the way evaluation is done and perform a special
function on a list:
.TP
.B \(**
Forces full evaluation on all the list elements following it. Use it to
force substitution of the current value of a variable. This is the only
operator that forces immediate evaluation.
.TP
.B +
When a
.B +
exists in a list that is fully evaluated, then all the elements before the
.B +
are imploded and all elements after the
.B +
are imploded and added to the list if they are not already in the list. So
this operator can be used either for set addition, or to force implosive
expansion within a sublist.
.TP
.B \-
Like
.BR + ,
except that elements after the
.B \-
are removed from the list.
.PP
The set operators can be used to gather options that exclude each other
or for their side effect of implosive expansion. You may want to write:
.PP
.RS
\fBcpp \-I$LIBPATH/include\fP
.RE
.PP
to call cpp with an extra include directory, but
.B $LIBPATH
is expanded using a filename starting with
.B \-I
so this won't work. Given that any problem in Computer Science can be solved
with an extra level of indirection, use this instead:
.PP
.RS
.ft B
cpp \-I$INCLUDE
.br
INCLUDE = $LIBPATH/include +
.ft P
.RE
.SS "Special Variables"
There are three special variables used in a description file:
.BR $\(** ,
.BR $< ,
and
.BR $> .
These variables are always local and mostly read-only. They will be
explained later.
.SS "A Program"
The lists in a description file form a program that is executed from the
first to the last list. The first word in a list may be recognized as a
builtin command (only if the first list element is indeed simply a word.)
If it is not a builtin command then the list is imploded and used as a
\s-2UNIX\s+2 command with arguments.
.PP
Indentation (by tabs or spaces) is not just makeup for a program, but are
used to group lines together. Some builtin commands need a body. These
bodies are simply lines at a deeper indentation.
.PP
Empty lines are not ignored either, they have the same indentation level as
the line before it. Comments (starting with a
.B #
and ending at end of line) have an indentation of their own and can be used
as null commands.
.PP
.B Acd
will complain about unexpected indentation shifts and empty bodies. Commands
can share the same body by placing them at the same indentation level before
the indented body. They are then "guards" to the same body, and are tried
one by one until one succeeds, after which the body is executed.
.PP
Semicolons may be used to separate commands instead of newlines. The commands
are then all at the indentation level of the first.
.SS "Execution phases"
The driver runs in three phases: Initialization, Argument scanning, and
Compilation. Not all commands work in all phases. This is further explained
below.
.SS "The Commands"
The commands accept arguments that are usually generic expressions that
implode to a word or a list of words. When
.I var
is specified, then a single word or subst needs to be given, so
an assignment can be either
.I name
.B =
.IR value ,
or
.BI $ name
.B =
.IR value .
.TP
.IB "var " = " expr ..."
The partially evaluated list of expressions is assigned to
.IR var .
During the evaluation is
.I var
marked as local, and after the assignment set from undefined to defined.
.TP
.BI unset " var"
.I Var
is set to null and is marked as undefined.
.TP
.BI import " var"
If
.I var
is defined in the environment of
.B acd
then it is assigned to
.IR var .
The environment variable is split into words at whitespace and colons. Empty
space between two colons
.RB ( :: )
is changed to a dot.
.TP
.BI mktemp " var " [ suffix ]
Assigns to
.I var
the name of a new temporary file, usually something like /tmp/acd12345x. If
.I suffix
is present then it will be added to the temporary file's name. (Use it
because some programs require it, or just because it looks good.)
.B Acd
remembers this file, and will delete it as soon as you stop referencing it.
.TP
.BI temporary " word"
Mark the file named by
.I word
as a temporary file. You have to make sure that the name is stored in some
list in imploded form, and not just temporarily created when
.I word
is evaluated, because then it will be immediately removed and forgotten.
.TP
.BI stop " suffix"
Sets the target suffix for the compilation phase. Something like
.B stop .o
means that the source files must be compiled to object files. At least one
.B stop
command must be executed before the compilation phase begins. It may not be
changed during the compilation phase. (Note: There is no restriction on
.IR suffix ,
it need not start with a dot.)
.TP
.BI treat " file suffix"
Marks the file as having the given suffix for the compile phase. Useful
for sending a
.B \-l
option directly to the loader by treating it as having the
.B .a
suffix.
.TP
.BI numeric " arg"
Checks if
.I arg
is a number. If not then
.B acd
will exit with a nice error message.
.TP
.BI error " expr ..."
Makes the driver print the error message
.I "expr ..."
and exit.
.TP
.BI if " expr " = " expr"
.B If
tests if the two expressions are equal using set comparison, i.e. each
expression should contain all the words in the other expression. If the
test succeeds then the if-body is executed.
.TP
.BI ifdef " var"
Executes the ifdef-body if
.I var
is defined.
.TP
.BI ifndef " var"
Executes the ifndef-body if
.I var
is undefined.
.TP
.BI iftemp " arg"
Executes the iftemp-body if
.I arg
is a temporary file. Use it when a command has the same file as input and
output and you don't want to clobber the source file:
.SP
.RS
.nf
.ft B
transform .o .o
iftemp $\(**
$> = $\(**
else
cp $\(** $>
optimize $>
.ft P
.fi
.RE
.TP
.BI ifhash " arg"
Executes the ifhash-body if
.I arg
is an existing file with a '\fB#\fP' as the very first character. This
usually indicates that the file must be pre-processed:
.SP
.RS
.nf
.ft B
transform .s .o
ifhash $\(**
mktemp ASM .s
$CPP $\(** > $ASM
else
ASM = $\(**
$AS \-o $> $ASM
unset ASM
.ft P
.fi
.RE
.TP
.B else
Executes the else-body if the last executed
.BR if ,
.BR ifdef ,
.BR ifndef ,
.BR iftemp ,
or
.B ifhash
was unsuccessful. Note that
.B else
need not immediately follow an if, but you are advised not to make use of
this. It is a "feature" that may not last.
.TP
.BI apply " suffix1 suffix2"
Executed inside a transform rule body to transform the input file according
to another transform rule that has the given input and output suffixes. The
file under
.B $\(**
will be replaced by the new file. So if there is a
.B .c .i
preprocessor rule then the example of
.B ifhash
can be replaced by:
.SP
.RS
.nf
.ft B
transform .s .o
ifhash $\(**
apply .c .i
$AS \-o $> $*
.ft P
.fi
.RE
.TP
.BI include " descr"
Reads another description file and replaces the
.B include
with it. Execution continues with the first list in the new program. The
search for
.I descr
is the same as used for the
.B \-descr
option. Use
.B include
to switch in different front ends or back ends, or to call a shared
description file with a different initialization. Note that
.I descr
is only evaluated the first time the
.B include
is called. After that the
.B include
has been replaced with the included program, so changing its argument won't
get you a different file.
.TP
.BI arg " string ..."
.B Arg
may be executed in the initialization and scanning phase to post an argument
scanning rule, that's all the command itself does. Like an
.B if
that fails it allows more guards to share the same body.
.TP
.BI transform " suffix1 suffix2"
.BR Transform ,
like
.BR arg ,
only posts a rule to transform a file with the suffix
.I suffix1
into a file with the suffix
.IR suffix2 .
.TP
.BI prefer " suffix1 suffix2"
Tells that the transformation rule from
.I suffix1
to
.I suffix2
is to be preferred when looking for a transformation path to the stop suffix.
Normally the shortest route to the stop suffix is used.
.B Prefer
is ignored on a
.BR combine ,
because the special nature of combines does not allow ambiguity.
.SP
The two suffixes on a
.B transform
or
.B prefer
may be the same, giving a rule that is only executed when preferred.
.TP
.BI combine " suffix-list suffix"
.B Combine
is like
.B transform
except that it allows a list of input suffixes to match several types of
input files that must be combined into one.
.TP
.B scan
The scanning phase may be run early from the initialization phase with the
.B scan
command. Use it if you need to make choices based on the arguments before
posting the transformation rules. After running this,
.B scan
and
.B arg
become no-ops.
.TP
.B compile
Move on to the compilation phase early, so that you have a chance to run
a few extra commands before exiting. This command implies a
.BR scan .
.PP
Any other command is seen as a \s-2UNIX\s+2 command. This is where the
.B <
and
.B >
operators come into play. They redirect standard input and standard output
to the file mentioned after them, just like the shell.
.B Acd
will stop with an error if the command is not successful.
.SS The Initialization Phase
The driver starts by executing the program once from top to bottom to
initialize variables and post argument scanning and transformation rules.
.SS The Scanning Phase
In this phase the driver makes a pass over the command line arguments to
process options. Each
.B arg
rule is tried one by one in the order they were posted against the front of
the argument list. If a match is made then the matched arguments are removed
from the argument list and the arg-body is executed. If no match can be made
then the first argument is moved to the list of files waiting to be
transformed and the scan is restarted.
.PP
The match is done as follows: Each of the strings after
.B arg
must match one argument at the front of the argument list. A character
in a string must match a character in an argument word, a subst in a string
may match 1 to all remaining characters in the argument, preferring the
shortest possible match. The hyphen in a argument starting with a hyphen
cannot be matched by a subst. Therefore:
.PP
.RS
.B arg \-i
.RE
.PP
matches only the argument
.BR \-i .
.PP
.RS
.B arg \-O$n
.RE
.PP
matches any argument that starts with
.B \-O
and is at least three characters long. Lastly,
.PP
.RS
.B arg \-o $out
.RE
.PP
matches
.B \-o
and the argument following it, unless that argument starts with a hyphen.
.PP
The variable
.B $\(**
is set to all the matched arguments before the arg-body is executed. All
the substs in the arg strings are set to the characters they match. The
variable
.B $>
is set to null. All the values of the variables are saved and the variables
marked local. All variables except
.B $>
are marked read-only. After the arg-body is executed is the value of
.B $>
concatenated to the file list. This allows one to stuff new files into the
transformation phase. These added names are not evaluated until the start
of the next phase.
.SS The Compilation Phase
The files gathered in the file list in the scanning phase are now transformed
one by one using the transformation rules. The shortest, or preferred route
is computed for each file all the way to the stop suffix. Each file is
transformed until it lands at the stop suffix, or at a combine rule. After
a while all files are either fully transformed or at a combine rule.
.PP
The driver chooses a combine rule that is not on a path from another combine
rule and executes it. The file that results is then transformed until it
again lands at a combine rule or the stop suffix. This continues until all
files are at the stop suffix and the program exits.
.PP
The paths through transform rules may be ambiguous and have cycles, they will
be resolved. But paths through combines must be unambiguous, because of
the many paths from the different files that meet there. A description file
will usually have only one combine rule for the loader. However if you do
have a combine conflict then put a no-op transform rule in front of one to
resolve the problem.
.PP
If a file matches a long and a short suffix then the long suffix is preferred.
By putting a null input suffix (\fB""\fP) in a rule one can match any file
that no other rule matches. You can send unknown files to the loader this
way.
.PP
The variable
.B $\(**
is set to the file to be transformed or the files to be combined before the
transform or combine-body is executed.
.B $>
is set to the output file name, it may again be modified.
.B $<
is set to the original name of the first file of
.B $\(**
with the leading directories and the suffix removed.
.B $\(**
will be made up of temporary files after the first rule.
.B $>
will be another temporary file or the name of the target file
.RB ( $<
plus the stop suffix), if the stop suffix is reached.
.PP
.B $>
is passed to the next rule; it is imploded and checked to be a single word.
This driver does not store intermediate object files in the current directory
like most other compilers, but keeps them in
.B /tmp
too. (Who knows if the current directory can have files created in?) As an
example, here is how you can express the "normal" method:
.PP
.RS
.nf
.ft B
transform .s .o
if $> = $<.o
# Stop suffix is .o
else
$> = $<.o
temporary $>
$AS \-o $> $\(**
.ft P
.fi
.RE
.PP
Note that
.B temporary
is not called if the target is already the object file, or you would lose
the intended result!
.B $>
is known to be a word, because
.B $<
is local. (Any string whose substs are all expanded changes to a word.)
.SS "Predefined Variables"
The driver has three variables predefined:
.BR PROGRAM ,
set to the call name of the driver,
.BR VERSION ,
the driver's version number, and
.BR ARCH ,
set to the name of the default output architecture. The latter is optional,
and only defined if
.B acd
was compiled with \fB\-DARCH=\e"\fP\fIarch-name\fP\fB\e"\fP.
.SH EXAMPLE
As an example a description file for a C compiler is given. It has a
front end (ccom), an intermediate code optimizer (opt), a code generator (cg),
an assembler (as), and a loader (ld). The compiler can pre-process, but
there is also a separate cpp. If the
.B \-D
and options like it are changed to look like
.B \-o
then this example is even as required by \s-2POSIX\s+2.
.RS
.nf
# The compiler support search path.
C = /lib /usr/lib /usr/local/lib
# Compiler passes.
CPP = $C/cpp $CPP_F
CCOM = $C/ccom $CPP_F
OPT = $C/opt
CG = $C/cg
AS = $C/as
LD = $C/ld
# Predefined symbols.
CPP_F = \-D__EXAMPLE_CC__
# Library path.
LIBPATH = $USERLIBPATH $C
# Default transformation target.
stop .out
# Preprocessor directives.
arg \-D$name
arg \-U$name
arg \-I$dir
CPP_F = $CPP_F $\(**
# Stop suffix.
arg \-c
stop .o
arg \-E
stop .E
# Optimization.
arg \-O
prefer .m .m
OPT = $OPT -O1
arg \-O$n
numeric $n
prefer .m .m
OPT = $OPT $\(**
# Add debug info to the executable.
arg \-g
CCOM = $CCOM -g
# Add directories to the library path.
arg \-L$dir
USERLIBPATH = $USERLIBPATH $dir
# \-llib must be searched in $LIBPATH later.
arg \-l$lib
$> = $LIBPATH/lib$lib.a
# Change output file.
arg \-o$out
arg \-o $out
OUT = $out
# Complain about a missing argument.
arg \-o
error "argument expected after '$\(**'"
# Any other option (like \-s) are for the loader.
arg \-$any
LD = $LD $\(**
# Preprocess C-source.
transform .c .i
$CPP $\(** > $>
# Preprocess C-source and send it to standard output or $OUT.
transform .c .E
ifndef OUT
$CPP $\(**
else
$CPP $\(** > $OUT
# Compile C-source to intermediate code.
transform .c .m
transform .i .m
$CCOM $\(** $>
# Intermediate code optimizer.
transform .m .m
$OPT $\(** > $>
# Intermediate to assembly.
transform .m .s
$CG $\(** > $>
# Assembler to object code.
transform .s .o
if $> = $<.o
ifdef OUT
$> = $OUT
$AS \-o $> $\(**
# Combine object files and libraries to an executable.
combine (.o .a) .out
ifndef OUT
OUT = a.out
$LD \-o $OUT $C/crtso.o $\(** $C/libc.a
.fi
.RE
.SH FILES
.TP 25n
.RI /usr/lib/ descr /descr
\- compiler driver description file.
.SH "SEE ALSO"
.BR cc (1).
.SH ACKNOWLEDGEMENTS
Even though the end result doesn't look much like it, many ideas were
nevertheless derived from the ACK compiler driver by Ed Keizer.
.SH BUGS
\s-2POSIX\s+2 requires that if compiling one source file to an object file
fails then the compiler should continue with the next source file. There is
no way
.B acd
can do this, it always stops after error. It doesn't even know what an
object file is! (The requirement is stupid anyhow.)
.PP
If you don't think that tabs are 8 spaces wide, then don't mix them with
spaces for indentation.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

63
man/man1/anm.1 Normal file
View file

@ -0,0 +1,63 @@
.TH ANM 1
.SH NAME
anm \- print name list
.SH SYNOPSIS
\fBanm \fR[\fB\-gnoprus\fR] \fIfile\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-g" "Global symbols only"
.FL "\-n" "Sort numerically"
.FL "\-o" "Prepend the filename to each line"
.FL "\-p" "No sorting\(emuse symbol table order"
.FL "\-r" "Sort in reverse order"
.FL "\-u" "List undefined symbols only"
.FL "\-s" "Sort in section order"
.SH EXAMPLES
.EX "anm \-gn test.o" "Print global symbols in numerical order"
.SH DESCRIPTION
.PP
.I Anm
prints the name list (symbol table) of each ACK format object
.I file
in the argument list.
If no file name is given, \fIa.out\fR is used.
Each symbol name is preceded by its value, a section indicator
and a type indicator.
The section indicators are:
.PP
.ta 0.25i 0.50i
.nf
\fBU\fR Undefined symbol
\fBA\fR Absolute symbol
\fB\-\fR Other symbol
.sp
The type indicators are:
.PP
\fBF\fR Filename
\fBM\fR Module name
\fBS\fR Section name
\fBE\fR External (global) symbol
\fB\-\fR Local symbol
.fi
.PP
The output is sorted alphabetically, unless otherwise specified.
Notice that \fIanm\fR can only be used on ACK format object files
(that is: \fI.o\fR and \fI.out\fR files).
If you want to get the name list of an executable program use
.I nm
instead.
.SH "SEE ALSO"
.BR asize (1),
.BR nm (1),
.BR ar (1),
.BR size (1).

56
man/man1/ar.1 Normal file
View file

@ -0,0 +1,56 @@
.TH AR 1
.SH NAME
ar, aal \- archivers
.SH SYNOPSIS
\fBar\fR [\fBdmpqrtx\fR][\fBabciluv\fR]\fR [\fIposname\fR] \fIarchive\fR [\fIfile \fR...]\fR
.br
\fBaal\fR [\fBdpqrtx\fR][\fBclv\fR]\fR \fIarchive\fR [\fIfile \fR...]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "ar r libc.a sort.s" "Replace \fIsort\fR.s in \fIlibc.a\fR"
.EX "ar rb a.s libc.a b.s" "Insert \fIb.s\fR before \fIa.s\fR in \fIlibc.a\fR"
.SH DESCRIPTION
.PP
\fIAr\fR allows groups of files to be put together into a single archive.
It is normally used for libraries of compiled procedures. \fIAal\fR is like
\fIar\fP, but is to be used with the ACK compiler. The following keys
are allowed:
.PP
.ta 0.25i 0.50i
.nf
\fBd\fR: Delete. \fIAr\fR will delete the named members.
\fBm\fR: Move named files. \fIAr\fR expects \fIa\fR, \fIb\fR, or \fIi\fR to be specified.
\fBp\fR: Print the named files (list them on \fIstdout\fR)
\fBq\fR: Quickly append to the end of the archive file.
\fBr\fR: Replace (append when not in archive).
\fBt\fR: Print the archive's table of contents.
\fBx\fR: Extract
.fi
.PP
\fBThe keys may optionally concatencated with one or more of the following\fR:
.nf
.PP
\fBa\fR: After \fIposname\fR
\fBb\fR: Before \fIposname\fR
\fBc\fR: Create (suppresses creation message)
\fBi\fR: Before \fIposname\fR
\fBl\fR: Local temporary file for work instead of \fI/tmp/ar.$$$$$\fR
\fBu\fR: Replace only if dated later than member in archive
\fBv\fR: Verbose
.PP
.fi
.SH "SEE ALSO"
.BR anm (1),
.BR asize (1),
.BR nm (1),
.BR size (1).

1123
man/man1/ash.1 Normal file

File diff suppressed because it is too large Load diff

37
man/man1/asize.1 Normal file
View file

@ -0,0 +1,37 @@
.TH ASIZE 1
.SH NAME
asize \- report the size of an object file
.SH SYNOPSIS
\fBasize \fIfile\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "asize test.o" "Give the size of \fItest.o\fR"
.SH DESCRIPTION
.PP
.I Asize
prints for each argument
the (decimal) number of bytes used by the different sections,
as well as their sum in decimal and hexadecimal.
If no
.I file
is given \fIa.out\fR is used.
.I Asize
can only be used to obtain the size of a \(M2 \fI.o\fR or \fI.out\fR file.
To obtain the size of an executable, use
.I size
instead.
.SH "SEE ALSO"
.BR anm (1),
.BR nm (1),
.BR ar (1),
.BR size (1).

34
man/man1/at.1 Normal file
View file

@ -0,0 +1,34 @@
.TH AT 1
.SH NAME
at \- execute commands at a later time
.SH SYNOPSIS
\fBat \fItime\fR [\fImonth day\fR] [\fIfile\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "at 2315 Jan 31 myfile" "Myfile executed Jan 31 at 11:15 pm"
.EX "at 0900" "Job input read from \fIstdin\fR"
.EX "at 0711 4 29 " "Read from \fIstdin\fR, exec on April 29"
.SH DESCRIPTION
.PP
\fBAt\fR prepares a file to be executed later at the specified time by
creating a special entry in \fB/usr/spool/at\fR. The \fBcron\fR daemon
takes care of executing these jobs. It checks to see if any
files in \fB/usr/spool/at\fR should now be run, and if so, it runs them
and then puts them in \fB/usr/spool/at/past\fR.
The name of the file created in \fB/usr/spool/at\fR by \fBat\fR is
YY.DDD.HHMM.UU (where YY, DDD, HH, and MM give the time to execute and
UU is a unique number). Note that when the command runs, it will not be able
to use standard input unless specifically redirected. Standard output
will be mailed to the owner of the job.
.SH "SEE ALSO"
.BR cron (8).

22
man/man1/banner.1 Normal file
View file

@ -0,0 +1,22 @@
.TH BANNER 1
.SH NAME
banner \- print a banner
.SH SYNOPSIS
\fBbanner \fIarg ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "banner happy birthday" "Print a banner saying happy birthday"
.SH DESCRIPTION
.PP
\fIBanner\fR prints its arguments on \fIstdout\fR using a matrix
of 6 x 6 pixels per character.

33
man/man1/basename.1 Normal file
View file

@ -0,0 +1,33 @@
.TH BASENAME 1
.SH NAME
basename, dirname \- strip off file prefixes and suffixes
.SH SYNOPSIS
\fBbasename \fIfile\fR [\fIsuffix\fR]\fR
.br
\fBdirname \fIfile\fR
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "basename /user/ast/file.c" "Strips path to yield \fIfile.c\fP"
.EX "basename /user/file.c .c" "Strips path and \fI.c\fP to yield \fIfile\fP"
.EX "dirname /user/file.c" "Strips basename to yield \fI/user\fP"
.SH DESCRIPTION
.PP
.I Basename
removes the initial directory names (if any) yielding the name of the
file itself.
If a second argument is present, it is interpreted as a suffix and is
also stripped, if present.
.PP
.I Dirname
removes the final component of a path, yielding the directory a file is in.
.PP
These programs are primarily used in shell scripts.

730
man/man1/bc.1 Normal file
View file

@ -0,0 +1,730 @@
.\"
.\" bc.1 - the *roff document processor source for the bc manual
.\"
.\" This file is part of bc written for MINIX.
.\" Copyright (C) 1991, 1992 Free Software Foundation, Inc.
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License , or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program; see the file COPYING. If not, write to
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
.\" You may contact the author by:
.\" e-mail: phil@cs.wwu.edu
.\" us-mail: Philip A. Nelson
.\" Computer Science Department, 9062
.\" Western Washington University
.\" Bellingham, WA 98226-9062
.\"
.\"
.TH bc 1 .\" "Command Manual" v1.02 "Feb 3, 1992"
.SH NAME
bc - An arbitrary precision calculator language
.SH SYNTAX
\fBbc\fR [ \fB-lws\fR ] [ \fI file ...\fR ]
.SH VERSION
This man page documents GNU bc version 1.02.
.SH DESCRIPTION
\fBbc\fR is a language that supports arbitrary precision numbers
with interactive execution of statements. There are some similarities
in the syntax to the C programming language.
A standard math library is available by command line option.
If requested, the math library is defined before processing any files.
\fBbc\fR starts by processing code from all the files listed
on the command line in the order listed. After all files have been
processed, \fBbc\fR reads from the standard input. All code is
executed as it is read. (If a file contains a command to halt the
processor, \fBbc\fR will never read from the standard input.)
.PP
This version of \fBbc\fR contains several extensions beyond
traditional \fBbc\fR implementations and the POSIX draft standard.
Command line options can cause these extensions to print a warning
or to be rejected. This
document describes the language accepted by this processor.
Extensions will be identified as such.
.SS OPTIONS
.IP -l
Define the standard math library.
.IP -w
Give warnings for extensions to POSIX \fBbc\fR.
.IP -s
Process exactly the POSIX \fBbc\fR language.
.SS NUMBERS
The most basic element in \fBbc\fR is the number. Numbers are
arbitrary precision numbers. This precision is both in the integer
part and the fractional part. All numbers are represented internally
in decimal and all computation is done in decimal. (This version
truncates results from divide and multiply operations.) There are two
attributes of numbers, the length and the scale. The length is the
total number of significant decimal digits in a number and the scale
is the total number of decimal digits after the decimal point. For
example:
.nf
.RS
.000001 has a length of 6 and scale of 6.
1935.000 has a length of 7 and a scale of 3.
.RE
.fi
.SS VARIABLES
Numbers are stored in two types of variables, simple variables and
arrays. Both simple variables and array variables are named. Names
begin with a letter followed by any number of letters, digits and
underscores. All letters must be lower case. (Full alpha-numeric
names are an extension. In POSIX \fBbc\fR all names are a single
lower case letter.) The type of variable is clear by the context
because all array variable names will be followed by brackets ([]).
.PP
There are four special variables, \fBscale, ibase, obase,\fR and
\fBlast\fR. \fBscale\fR defines how some operations use digits after the
decimal point. The default value of \fBscale\fR is 0. \fBibase\fR
and \fBobase\fR define the conversion base for input and output
numbers. The default for both input and output is base 10.
\fBlast\fR (an extension) is a variable that has the value of the last
printed number. These will be discussed in further detail where
appropriate. All of these variables may have values assigned to them
as well as used in expressions.
.SS COMMENTS
Comments in \fBbc\fR start with the characters \fB/*\fR and end with
the characters \fB*/\fR. Comments may start anywhere and appear as a
single space in the input. (This causes comments to delimit other
input items. For example, a comment can not be found in the middle of
a variable name.) Comments include any newlines (end of line) between
the start and the end of the comment.
.SS EXPRESSIONS
The numbers are manipulated by expressions and statements. Since
the language was designed to be interactive, statements and expressions
are executed as soon as possible. There is no "main" program. Instead,
code is executed as it is encountered. (Functions, discussed in
detail later, are defined when encountered.)
.PP
A simple expression is just a constant. \fBbc\fR converts constants
into internal decimal numbers using the current input base, specified
by the variable \fBibase\fR. (There is an exception in functions.)
The legal values of \fBibase\fR are 2 through 16 (F). Assigning a
value outside this range to \fBibase\fR will result in a value of 2
or 16. Input numbers may contain the characters 0-9 and A-F. (Note:
They must be capitals. Lower case letters are variable names.)
Single digit numbers always have the value of the digit regardless of
the value of \fBibase\fR. (i.e. A = 10.) For multi-digit numbers,
\fBbc\fR changes all input digits greater or equal to ibase to the
value of \fBibase\fR-1. This makes the number \fBFFF\fR always be
the largest 3 digit number of the input base.
.PP
Full expressions are similar to many other high level languages.
Since there is only one kind of number, there are no rules for mixing
types. Instead, there are rules on the scale of expressions. Every
expression has a scale. This is derived from the scale of original
numbers, the operation performed and in many cases, the value of the
variable \fBscale\fR. Legal values of the variable \fBscale\fR are
0 to the maximum number representable by a C integer.
.PP
In the following descriptions of legal expressions, "expr" refers to a
complete expression and "var" refers to a simple or an array variable.
A simple variable is just a
.RS
\fIname\fR
.RE
and an array variable is specified as
.RS
\fIname\fR[\fIexpr\fR]
.RE
Unless specifically
mentioned the scale of the result is the maximum scale of the
expressions involved.
.IP "- expr"
The result is the negation of the expression.
.IP "++ var"
The variable is incremented by one and the new value is the result of
the expression.
.IP "-- var"
The variable
is decremented by one and the new value is the result of the
expression.
.IP "var ++"
The result of the expression is the value of
the variable and then the variable is incremented by one.
.IP "var --"
The result of the expression is the value of the variable and then
the variable is decremented by one.
.IP "expr + expr"
The result of the expression is the sum of the two expressions.
.IP "expr - expr"
The result of the expression is the difference of the two expressions.
.IP "expr * expr"
The result of the expression is the product of the two expressions.
.IP "expr / expr"
The result of the expression is the quotient of the two expressions.
The scale of the result is the value of the variable \fBscale\fR.
.IP "expr % expr"
The result of the expression is the "remainder" and it is computed in the
following way. To compute a%b, first a/b is computed to \fBscale\fR
digits. That result is used to compute a-(a/b)*b to the scale of the
maximum of \fBscale\fR+scale(b) and scale(a). If \fBscale\fR is set
to zero and both expressions are integers this expression is the
integer remainder function.
.IP "expr ^ expr"
The result of the expression is the value of the first raised to the
second. The second expression must be an integer. (If the second
expression is not an integer, a warning is generated and the
expression is truncated to get an integer value.) The scale of the
result is \fBscale\fR if the exponent is negative. If the exponent
is positive the scale of the result is the minimum of the scale of the
first expression times the value of the exponent and the maximum of
\fBscale\fR and the scale of the first expression. (e.g. scale(a^b)
= min(scale(a)*b, max( \fBscale,\fR scale(a))).) It should be noted
that expr^0 will always return the value of 1.
.IP "( expr )"
This alters the standard precedence to force the evaluation of the
expression.
.IP "var = expr"
The variable is assigned the value of the expression.
.IP "var <op>= expr"
This is equivalent to "var = var <op> expr" with the exception that
the "var" part is evaluated only once. This can make a difference if
"var" is an array.
.PP
Relational expressions are a special kind of expression
that always evaluate to 0 or 1, 0 if the relation is false and 1 if
the relation is true. These may appear in any legal expression.
(POSIX bc requires that relational expressions are used only in if,
while, and for statements and that only one relational test may be
done in them.) The relational operators are
.IP "expr1 < expr2"
The result is 1 if expr1 is strictly less than expr2.
.IP "expr1 <= expr2"
The result is 1 if expr1 is less than or equal to expr2.
.IP "expr1 > expr2"
The result is 1 if expr1 is strictly greater than expr2.
.IP "expr1 >= expr2"
The result is 1 if expr1 is greater than or equal to expr2.
.IP "expr1 == expr2"
The result is 1 if expr1 is equal to expr2.
.IP "expr1 != expr2"
The result is 1 if expr1 is not equal to expr2.
.PP
Boolean operations are also legal. (POSIX \fBbc\fR does NOT have
boolean operations). The result of all boolean operations are 0 and 1
(for false and true) as in relational expressions. The boolean
operators are:
.IP "!expr"
The result is 1 if expr is 0.
.IP "expr && expr"
The result is 1 if both expressions are non-zero.
.IP "expr || expr"
The result is 1 if either expression is non-zero.
.PP
The expression precedence is as follows: (lowest to highest)
.nf
.RS
|| operator, left associative
&& operator, left associative
! operator, nonassociative
Relational operators, left associative
Assignment operator, right associative
+ and - operators, left associative
*, / and % operators, left associative
^ operator, right associative
unary - operator, nonassociative
++ and -- operators, nonassociative
.RE
.fi
.PP
This precedence was chosen so that POSIX compliant \fBbc\fR programs
will run correctly. This will cause the use of the relational and
logical operators to have some unusual behavior when used with
assignment expressions. Consider the expression:
.RS
a = 3 < 5
.RE
.PP
Most C programmers would assume this would assign the result of "3 <
5" (the value 1) to the variable "a". What this does in \fBbc\fR is
assign the value 3 to the variable "a" and then compare 3 to 5. It is
best to use parenthesis when using relational and logical operators
with the assignment operators.
.PP
There are a few more special expressions that are provided in \fBbc\fR.
These have to do with user defined functions and standard
functions. They all appear as "\fIname\fB(\fIparameters\fB)\fR".
See the section on functions for user defined functions. The standard
functions are:
.IP "length ( expression )"
The value of the length function is the number of significant digits in the
expression.
.IP "read ( )"
The read function (an extension) will read a number from the standard
input, regardless of where the function occurs. Beware, this can
cause problems with the mixing of data and program in the standard input.
The best use for this function is in a previously written program that
needs input from the user, but never allows program code to be input
from the user. The value of the read function is the number read from
the standard input using the current value of the variable
\fBibase\fR for the conversion base.
.IP "scale ( expression )"
The value of the scale function is the number of digits after the decimal
point in the expression.
.IP "sqrt ( expression )"
The value of the sqrt function is the square root of the expression. If
the expression is negative, a run time error is generated.
.SS STATEMENTS
Statements (as in most algebraic languages) provide the sequencing of
expression evaluation. In \fBbc\fR statements are executed "as soon
as possible." Execution happens when a newline in encountered and
there is one or more complete statements. Due to this immediate
execution, newlines are very important in \fBbc\fR. In fact, both a
semicolon and a newline are used as statement separators. An
improperly placed newline will cause a syntax error. Because newlines
are statement separators, it is possible to hide a newline by using
the backslash character. The sequence "\e<nl>", where <nl> is the
newline appears to \fBbc\fR as whitespace instead of a newline. A
statement list is a series of statements separated by semicolons and
newlines. The following is a list of \fBbc\fR statements and what
they do: (Things enclosed in brackets ([]) are optional parts of the
statement.)
.IP "expression"
This statement does one of two things. If the expression starts with
"<variable> <assignment> ...", it is considered to be an assignment
statement. If the expression is not an assignment statement, the
expression is evaluated and printed to the output. After the number
is printed, a newline is printed. For example, "a=1" is an assignment
statement and "(a=1)" is an expression that has an embedded
assignment. All numbers that are printed are printed in the base
specified by the variable \fBobase\fR. The legal values for \fB
obase\fR are 2 through BC_BASE_MAX. (See the section LIMITS.) For
bases 2 through 16, the usual method of writing numbers is used. For
bases greater than 16, \fBbc\fR uses a multi-character digit method
of printing the numbers where each higher base digit is printed as a
base 10 number. The multi-character digits are separated by spaces.
Each digit contains the number of characters required to represent the
base ten value of "obase-1". Since numbers are of arbitrary
precision, some numbers may not be printable on a single output line.
These long numbers will be split across lines using the "\e" as the
last character on a line. The maximum number of characters printed
per line is 70. Due to the interactive nature of \fBbc\fR printing
a number cause the side effect of assigning the printed value the the
special variable \fBlast\fR. This allows the user to recover the
last value printed without having to retype the expression that
printed the number. Assigning to \fBlast\fR is legal and will
overwrite the last printed value with the assigned value. The newly
assigned value will remain until the next number is printed or another
value is assigned to \fBlast\fR.
.IP "string"
The string is printed to the output. Strings start with a double quote
character and contain all characters until the next double quote character.
All characters are take literally, including any newline. No newline
character is printed after the string.
.IP "\fBprint\fR list"
The print statement (an extension) provides another method of output.
The "list" is a list of strings and expressions separated by commas.
Each string or expression is printed in the order of the list. No
terminating newline is printed. Expressions are evaluated and their
value is printed and assigned the the variable \fBlast\fR. Strings
in the print statement are printed to the output and may contain
special characters. Special characters start with the backslash
character (\e). The special characters recognized by \fBbc\fR are
"b" (bell), "f" (form feed), "n" (newline), "r" (carriage return), "t"
(tab), and "\e" (backslash). Any other character following the
backslash will be ignored. This still does not allow the double quote
character to be part of any string.
.IP "{ statement_list }"
This is the compound statement. It allows multiple statements to be
grouped together for execution.
.IP "\fBif\fR ( expression ) \fBthen\fR statement1 [\fBelse\fR statement2]"
The if statement evaluates the expression and executes statement1 or
statement2 depending on the value of the expression. If the expression
is non-zero, statement1 is executed. If statement2 is present and
the value of the expression is 0, then statement2 is executed. (The
else clause is an extension.)
.IP "\fBwhile\fR ( expression ) statement"
The while statement will execute the statement while the expression
is non-zero. It evaluates the expression before each execution of
the statement. Termination of the loop is caused by a zero
expression value or the execution of a break statement.
.IP "\fBfor\fR ( [expression1] ; [expression2] ; [expression3] ) statement"
The for statement controls repeated execution of the statement.
Expression1 is evaluated before the loop. Expression2 is evaluated
before each execution of the statement. If it is non-zero, the statement
is evaluated. If it is zero, the loop is terminated. After each
execution of the statement, expression3 is evaluated before the reevaluation
of expression2. If expression1 or expression3 are missing, nothing is
evaluated at the point they would be evaluated.
If expression2 is missing, it is the same as substituting
the value 1 for expression2. (The optional expressions are an
extension. POSIX \fBbc\fR requires all three expressions.)
The following is equivalent code for the for statement:
.nf
.RS
expression1;
while (expression2) {
statement;
expression3;
}
.RE
.fi
.IP "\fBbreak\fR"
This statement causes a forced exit of the most recent enclosing while
statement or for statement.
.IP "\fBcontinue\fR"
The continue statement (an extension) causes the most recent enclosing
for statement to start the next iteration.
.IP "\fBhalt\fR"
The halt statement (an extension) is an executed statement that causes
the \fBbc\fR processor to quit only when it is executed. For example,
"if (0 == 1) halt" will not cause \fBbc\fR to terminate because the halt is
not executed.
.IP "\fBreturn\fR"
Return the value 0 from a function. (See the section on functions.)
.IP "\fBreturn\fR ( expression )"
Return the value of the expression from a function. (See the section on
functions.)
.SS PSEUDO STATEMENTS
These statements are not statements in the traditional sense. They are
not executed statements. Their function is performed at "compile" time.
.IP "\fBlimits\fR"
Print the local limits enforced by the local version of \fBbc\fR. This
is an extension.
.IP "\fBquit\fR"
When the quit statement is read, the \fBbc\fR processor
is terminated, regardless of where the quit statement is found. For
example, "if (0 == 1) quit" will cause \fBbc\fR to terminate.
.IP "\fBwarranty\fR"
Print a longer warranty notice. This is an extension.
.SS FUNCTIONS
Functions provide a method of defining a computation that can be executed
later. Functions in
.B bc
always compute a value and return it to the caller. Function definitions
are "dynamic" in the sense that a function is undefined until a definition
is encountered in the input. That definition is then used until another
definition function for the same name is encountered. The new definition
then replaces the older definition. A function is defined as follows:
.nf
.RS
\fBdefine \fIname \fB( \fIparameters \fB) { \fInewline
\fI auto_list statement_list \fB}\fR
.RE
.fi
A function call is just an expression of the form
"\fIname\fB(\fIparameters\fB)\fR".
.PP
Parameters are numbers or arrays (an extension). In the function definition,
zero or more parameters are defined by listing their names separated by
commas. Numbers are only call by value parameters. Arrays are only
call by variable. Arrays are specified in the parameter definition by
the notation "\fIname\fB[]\fR". In the function call, actual parameters
are full expressions for number parameters. The same notation is used
for passing arrays as for defining array parameters. The named array is
passed by variable to the function. Since function definitions are dynamic,
parameter numbers and types are checked when a function is called. Any
mismatch in number or types of parameters will cause a runtime error.
A runtime error will also occur for the call to an undefined function.
.PP
The \fIauto_list\fR is an optional list of variables that are for
"local" use. The syntax of the auto list (if present) is "\fBauto
\fIname\fR, ... ;". (The semicolon is optional.) Each \fIname\fR is
the name of an auto variable. Arrays may be specified by using the
same notation as used in parameters. These variables have their
values pushed onto a stack at the start of the function. The
variables are then initialized to zero and used throughout the
execution of the function. At function exit, these variables are
popped so that the original value (at the time of the function call)
of these variables are restored. The parameters are really auto
variables that are initialized to a value provided in the function
call. Auto variables are different than traditional local variables
in the fact that if function A calls function B, B may access function
A's auto variables by just using the same name, unless function B has
called them auto variables. Due to the fact that auto variables and
parameters are pushed onto a stack, \fBbc\fR supports recursive functions.
.PP
The function body is a list of \fBbc\fR statements. Again, statements
are separated by semicolons or newlines. Return statements cause the
termination of a function and the return of a value. There are two
versions of the return statement. The first form, "\fBreturn\fR", returns
the value 0 to the calling expression. The second form,
"\fBreturn ( \fIexpression \fB)\fR", computes the value of the expression
and returns that value to the calling expression. There is an implied
"\fBreturn (0)\fR" at the end of every function. This allows a function
to terminate and return 0 without an explicit return statement.
.PP
Functions also change the usage of the variable \fBibase\fR. All
constants in the function body will be converted using the value of
\fBibase\fR at the time of the function call. Changes of \fBibase\fR
will be ignored during the execution of the function except for the
standard function \fBread\fR, which will always use the current value
of \fBibase\fR for conversion of numbers.
.SS MATH LIBRARY
If \fBbc\fR is invoked with the \fB-l\fR option, a math library is preloaded
and the default scale is set to 20. The math functions will calculate their
results to the scale set at the time of their call.
The math library defines the following functions:
.IP "s (\fIx\fR)"
The sine of x in radians.
.IP "c (\fIx\fR)"
The cosine of x in radians.
.IP "a (\fIx\fR)"
The arctangent of x.
.IP "l (\fIx\fR)"
The natural logarithm of x.
.IP "e (\fIx\fR)"
The exponential function of raising e to the value x.
.IP "j (\fIn,x\fR)"
The bessel function of integer order n of x.
.SS EXAMPLES
In /bin/sh, the following will assign the value of "pi" to the shell
variable \fBpi\fR.
.RS
\fB
pi=$(echo "scale=10; 4*a(1)" | bc -l)
\fR
.RE
.PP
The following is the definition of the exponential function used in the
math library. This function is written in POSIX \fBbc\fR.
.nf
.RS
\fB
scale = 20
/* Uses the fact that e^x = (e^(x/2))^2
When x is small enough, we use the series:
e^x = 1 + x + x^2/2! + x^3/3! + ...
*/
define e(x) {
auto a, d, e, f, i, m, v, z
/* Check the sign of x. */
if (x<0) {
m = 1
x = -x
}
/* Precondition x. */
z = scale;
scale = 4 + z + .44*x;
while (x > 1) {
f += 1;
x /= 2;
}
/* Initialize the variables. */
v = 1+x
a = x
d = 1
for (i=2; 1; i++) {
e = (a *= x) / (d *= i)
if (e == 0) {
if (f>0) while (f--) v = v*v;
scale = z
if (m) return (1/v);
return (v/1);
}
v += e
}
}
\fR
.RE
.fi
.PP
The following is code that uses the extended features of \fBbc\fR to
implement a simple program for calculating checkbook balances. This
program is best kept in a file so that it can be used many times
without having to retype it at every use.
.nf
.RS
\fB
scale=2
print "\enCheck book program!\en"
print " Remember, deposits are negative transactions.\en"
print " Exit by a 0 transaction.\en\en"
print "Initial balance? "; bal = read()
bal /= 1
print "\en"
while (1) {
"current balance = "; bal
"transaction? "; trans = read()
if (trans == 0) break;
bal -= trans
bal /= 1
}
quit
\fR
.RE
.fi
.PP
The following is the definition of the recursive factorial function.
.nf
.RS
\fB
define f (x) {
if (x <= 1) return (1);
return (f(x-1) * x);
}
\fR
.RE
.fi
.SS DIFFERENCES
This version of
.B bc
was implemented from the POSIX P1003.2/D11 draft and contains
several differences and extensions relative to the draft and
traditional implementations.
It is not implemented in the traditional way using
.I dc(1).
This version is a single process which parses and runs a byte code
translation of the program. There is an "undocumented" option (-c)
that causes the program to output the byte code to
the standard output instead of running it. It was mainly used for
debugging the parser and preparing the math library.
.PP
A major source of differences is
extensions, where a feature is extended to add more functionality and
additions, where new features are added.
The following is the list of differences and extensions.
.IP LANG 11n
This version does not conform to the POSIX standard in the processing
of the LANG environment variable and all environment variables starting
with LC_.
.IP names
Traditional and POSIX
.B bc
have single letter names for functions, variables and arrays. They have
been extended to be multi-character names that start with a letter and
may contain letters, numbers and the underscore character.
.IP Strings
Strings are not allowed to contain NUL characters. POSIX says all characters
must be included in strings.
.IP last
POSIX \fBbc\fR does not have a \fBlast\fR variable. Some implementations
of \fBbc\fR use the period (.) in a similar way.
.IP comparisons
POSIX \fBbc\fR allows comparisons only in the if statement, the while
statement, and the second expression of the for statement. Also, only
one relational operation is allowed in each of those statements.
.IP "if statement, else clause"
POSIX \fBbc\fR does not have an else clause.
.IP "for statement"
POSIX \fBbc\fR requires all expressions to be present in the for statement.
.IP "&&, ||, !"
POSIX \fBbc\fR does not have the logical operators.
.IP "read function"
POSIX \fBbc\fR does not have a read function.
.IP "print statement"
POSIX \fBbc\fR does not have a print statement .
.IP "continue statement"
POSIX \fBbc\fR does not have a continue statement.
.IP "array parameters"
POSIX \fBbc\fR does not have array parameters. Other implementations
of \fBbc\fR may have call by value array parameters.
.IP "=+, =-, =*, =/, =%, =^"
POSIX \fBbc\fR does not require these "old style" assignment operators to
be defined. This version may allow these "old style" assignments. Use
the limits statement to see if the installed version supports them. If
it does support the "old style" assignment operators, the statement
"a =- 1" will decrement \fBa\fR by 1 instead of setting \fBa\fR to the
value -1.
.IP "spaces in numbers"
Other implementations of \fBbc\fR allow spaces in numbers. For example,
"x=1 3" would assign the value 13 to the variable x. The same statement
would cause a syntax error in this version of \fBbc\fR.
.IP "errors and execution"
This implementation varies from other implementations in terms of what
code will be executed when syntax and other errors are found in the
program. If a syntax error is found in a function definition, error
recovery tries to find the beginning of a statement and continue to
parse the function. Once a syntax error is found in the function, the
function will not be callable and becomes undefined.
Syntax errors in the interactive execution code will invalidate the
current execution block. The execution block is terminated by an
end of line that appears after a complete sequence of statements.
For example,
.nf
.RS
a = 1
b = 2
.RE
.fi
has two execution blocks and
.nf
.RS
{ a = 1
b = 2 }
.RE
.fi
has one execution block. Any runtime error will terminate the execution
of the current execution block. A runtime warning will not terminate the
current execution block.
.IP "Interrupts"
During an interactive session, the SIGINT signal (usually generated by
the control-C character from the terminal) will cause execution of the
current execution block to be interrupted. It will display a "runtime"
error indicating which function was interrupted. After all runtime
structures have been cleaned up, a message will be printed to notify the
user that \fBbc\fR is ready for more input. All previously defined functions
remain defined and the value of all non-auto variables are the value at
the point of interruption. All auto variables and function parameters
are removed during the
clean up process. During a non-interactive
session, the SIGINT signal will terminate the entire run of \fBbc\fR.
.SS LIMITS
The following are the limits currently in place for this
.B bc
processor. Some of them may have been changed by an installation.
Use the limits statement to see the actual values.
.IP BC_BASE_MAX
The maximum output base is currently set at 999. The maximum input base
is 16.
.IP BC_DIM_MAX
This is currently an arbitrary limit of 65535 as distributed. Your
installation may be different.
.IP BC_SCALE_MAX
The number of digits after the decimal point is limited to INT_MAX digits.
Also, the number of digits before the decimal point is limited to INT_MAX
digits.
.IP BC_STRING_MAX
The limit on the number of characters in a string is INT_MAX characters.
.IP exponent
The value of the exponent in the raise operation (^) is limited to LONG_MAX.
.IP multiply
The multiply routine may yield incorrect results if a number
has more than LONG_MAX / 90 total digits. For 32 bit longs, this number is
23,860,929 digits.
.IP "code size"
Each function and the "main" program are limited to 10240 bytes of
compiled byte code each. This limit (BC_MAX_SEGS) can be easily changed
to have more than 10 segments of 1024 bytes.
.IP "variable names"
The current limit on the number of unique names is 32767 for each of
simple variables, arrays and functions.
.SH FILES
In most installations, \fBbc\fR is completely self-contained.
Where executable size is of importance or the C compiler does
not deal with very long strings, \fBbc\fR will read
the standard math library from the file /usr/local/lib/libmath.b.
(The actual location may vary. It may be /lib/libmath.b.)
.SH DIAGNOSTICS
If any file on the command line can not be opened, \fBbc\fR will report
that the file is unavailable and terminate. Also, there are compile
and run time diagnostics that should be self-explanatory.
.SH BUGS
Error recovery is not very good yet.
.SH AUTHOR
.nf
Philip A. Nelson
phil@cs.wwu.edu
.fi
.SH ACKNOWLEDGEMENTS
The author would like to thank Steve Sommars (sesv@iwtsf.att.com) for
his extensive help in testing the implementation. Many great suggestions
were given. This is a much better product due to his involvement.

86
man/man1/bsfilt.1 Normal file
View file

@ -0,0 +1,86 @@
.\" manual page for bsfilt(1)
.\"
.\"
.\" Copyright (c) 1991 Purdue University Research Foundation,
.\" West Lafayette, Indiana 47907. All rights reserved.
.\"
.\" Written by Victor A. Abell <abe@mace.cc.purdue.edu>, Purdue
.\" University Computing Center. Not derived from licensed software;
.\" derived from awf(1) by Henry Spencer of the University of Toronto.
.\"
.\" Permission is granted to anyone to use this software for any
.\" purpose on any computer system, and to alter it and redistribute
.\" it freely, subject to the following restrictions:
.\"
.\" 1. The author is not responsible for any consequences of use of
.\" this software, even if they arise from flaws in it.
.\"
.\" 2. The origin of this software must not be misrepresented, either
.\" by explicit claim or by omission. Credits must appear in the
.\" documentation.
.\"
.\" 3. Altered versions must be plainly marked as such, and must not
.\" be misrepresented as being the original software. Credits must
.\" appear in the documentation.
.\"
.\" 4. This notice may not be removed or altered.
.\"
.TH BSFILT 1 "February, 1991"
.BY "Purdue University"
.SH NAME
bsfilt, colcrt \- a colcrt-like backspace filter
.SH SYNOPSIS
.B bsfilt
[
.B -
] [
.B -U
] [ file ... ]
.SH DESCRIPTION
.I Bsfilt
filters backspace sequences from the input \fIfile\fR(s)
(standard input if none)
in an approximation of
.IR colcrt (1).
Both the backspace and the character it returns to are removed,
unless they form an underline sequence.
Underline sequences are treated according to the settings of
the
.B \-
and
.B \-U
options.
.SH OPTIONS
.TP
.B \-
specifies that no underlining of any kind is to be propagated.
Without this option or the
.B \-U
option,
.I bsfilt
approximates underlining with minus signs (`-') in following lines.
.TP
.B \-U
specifies that underlining with underscore (`_') and backspace (`\b')
character sequences is permitted.
.SH SEE ALSO
cawf(1), colcrt(1) and nroff(1).
.SH DIAGNOSTICS
Diagnostic messages are delivered to the standard error file.
.SH HISTORY
Vic Abell of Purdue University wrote
.I bsfilt
to have a backspace filter for
.IR cawf (1)
that is independent of licensed source code.
.SH BUGS
The maximum length of a line that can be underlined with minus signs is
fixed.
.LP
.I Bsfilt
does not examine the characters that are being overprinted via backspace
operations.
Thus, overprinting that is intended to form a new character from several
different ones is ineffective and only the last character of the
sequence is propagated \- e. g., ``o^H+'', intended to look like
a bullet, is reduced to `+'.

27
man/man1/cal.1 Normal file
View file

@ -0,0 +1,27 @@
.TH CAL 1
.SH NAME
cal \- print a calendar
.SH SYNOPSIS
\fBcal\fR [\fImonth\fR] \fIyear\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "cal 3 1992" "Print March 1992"
.SH DESCRIPTION
.PP
\fICal\fR prints a calendar for a month or year. The year can be
between 1 and 9999.
Note that the year 91 is not a synonym for 1991, but is itself a
valid year about 19 centuries ago. The calendar produced is the one used
by England and her colonies. Try Sept. 1752, Feb 1900, and Feb 2000. If
you do not understand what is going on, look up \fICalendar, Gregorian\fR in a
good encyclopedia.

44
man/man1/calendar.1 Normal file
View file

@ -0,0 +1,44 @@
.TH CALENDAR 1
.SH NAME
calendar \- reminder service
.SH SYNOPSIS
\fBcalendar [\fB\-\fR] [\fB\-r\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-" "Work for every user and send mail to him"
.FL "\-r" "Restrict multiple execution on the same day"
.SH EXAMPLES
.EX "calendar" "Check \fIcalendar\fR file in current directory"
.EX "calendar" "Normary used under the control of cron(8)"
.EX "calendar \-r" " Normary used in /etc/rc file"
.SH DESCRIPTION
.PP
Basically \fIcalendar\fR program consults the file \fIcalendar\fR in the
current directory and display lines which contain today's or tomorrow's date.
Month-day formats such
as '12/25', 'Dec. 25', 'december 25', '*/25', '12/*', '*/*' are
recognized. The asterisk
means 'all' days or 'all' months. On weekends 'tomorrow' extends through
next Monday without any consideration about holidays.
To prevent ambiguity, the formats '25 Dec.' and '25/12' are not recognized.
.PP
When an argument \fB\-\fR is present, \fIcalendar\fR works for all users
with a file \fIcalendar\fR in their login directories and sends them mail.
Normally this is done daily under the control of \fIcron\fR.
.PP
The \fB\-r\fR option does its the same job as \fB\-\fR option, but touches
the \fIcalendar\fR to prevents further access on the same day.
Normally this is done in the \fI/etc/rc\fR file on a machine which may be
booted several times in one day.
.SH "SEE ALSO"
.BR cron (8).

33
man/man1/cat.1 Normal file
View file

@ -0,0 +1,33 @@
.TH CAT 1
.SH NAME
cat \- concatenate files and write them to stdout
.SH SYNOPSIS
\fBcat\fR [\fB\-u\fR]\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-u" "Unbuffered output"
.SH EXAMPLES
.EX "cat file" "Display file on the terminal"
.EX "cat file1 file2 | lp" "Concatenate 2 files and print result"
.SH DESCRIPTION
.PP
.I Cat
concatenates its input files and copies the result to \fIstdout\fR.
If no input file is named, or \- is encountered as a file name, standard
input is used.
Output is buffered in 512 byte blocks unless the
.B \-u
flag is given.
If you just want to copy a file, \fIcp\fR should be used since it is faster.
.SH "SEE ALSO"
.BR cp (1).

760
man/man1/cawf.1 Normal file
View file

@ -0,0 +1,760 @@
.\" manual page for cawf(1)
.\"
.\"
.\" Copyright (c) 1991 Purdue University Research Foundation,
.\" West Lafayette, Indiana 47907. All rights reserved.
.\"
.\" Written by Victor A. Abell <abe@cc.purdue.edu>, Purdue
.\" University Computing Center. Not derived from licensed software;
.\" derived from awf(1) by Henry Spencer of the University of Toronto.
.\"
.\" Permission is granted to anyone to use this software for any
.\" purpose on any computer system, and to alter it and redistribute
.\" it freely, subject to the following restrictions:
.\"
.\" 1. The author is not responsible for any consequences of use of
.\" this software, even if they arise from flaws in it.
.\"
.\" 2. The origin of this software must not be misrepresented, either
.\" by explicit claim or by omission. Credits must appear in the
.\" documentation.
.\"
.\" 3. Altered versions must be plainly marked as such, and must not
.\" be misrepresented as being the original software. Credits must
.\" appear in the documentation.
.\"
.\" 4. This notice may not be removed or altered.
.\"
.\" Some of the stuff in this file is a bit contorted, because it's also
.\" the regression-test input.
.nr ES 5n
.de ES
.PP
.in +\\n(ESu
.nf
..
.de EE
.in -\\n(ESu
.fi
.PP
..
.de PT
.ie \\n(.$>1 .TP "\\$2"
.el .TP
.ie !'\\$1'' \\$1
.el \(bu
..
.ds Nr \fInroff\fR
.TH CAWF 1 "November, 1992"
.BY "Purdue University"
.SH NAME
cawf, nroff \- C version of the nroff-like, Amazingly Workable (text) Formatter
.SH SYNOPSIS
.B cawf
.RB [ \-c\c
.IR config ]
.RB [ \-d\c
.IR device ]
.RB [ \-e ]
.RB [ \-f\c
.IR font ]
.RB [ \-h ]
.RB [ \-m\c
.IR acros ]
.RI [ file " ...]"
.SH DESCRIPTION
.I Cawf
formats the text from the input \fIfile\fR(s)
(standard input if none)
in an approximation of \*(Nr.
It comes closest to duplicating \*(Nr's
.B man
or
.B ms
macro package styles.
It has some limited support for \*(Nr's
.B me
macros.
.SH OPTIONS
Options must precede file names.
.TP
.BI \-c config
defines an alternate path to the device configuration file.
Normally the device configuration file is found in
.I device.cf
in the
.I cawf
library (see the
.B FILES
section).
.IP
The device configuration file contains device character strings for
selecting fonts and the bold or italic type faces.
See the
.B DEVICES
section for more information.
.TP
.BI \-d device
specifies the name of the output device.
There are three built\-in devices \- ANSI, NONE and NORMAL \- and
other devices may be defined in the device configuration file.
See the
.B DEVICES
section for more information.
.IP
The NORMAL device is the default.
.TP
.B \-e
directs
.I cawf
to issue an eject (FF or ^L) after the last page.
.TP
.BI \-f font
specifies the one font for the device, declared with the
.BI \-d device
option, that is to be used for the
entire document.
.I Font
must match a font associated with the device's stanza in the device
configuration file.
See the
.B DEVICES
section for more information.
.IP
No
.I font
may be specified for the built\-in devices ANSI, NONE or NORMAL.
.TP
.B \-h
requests a help display.
.TP
.BI \-m acro
specifies the macro file to be used.
The standard
.I cawf
distribution supplies macro files to support ``\-man'', ``\-me'' or ``\-ms''.
.I Cawf
finds a macro file by constructing its name from `m',
.I acro
and
.B .mac
\- e. g.,
.BI \-m an
is converted to
.BR man.mac .
The default directory for macro files is defined when
.I cawf
is compiled; it's \fIC:\\SYS\\LIB\\CAWF\fP in the MS\-DOS environment;
.I /usr/lib/cawf
in the UNIX environment.
.TP
file ...
are the names of files containing \*(Nr source text.
.SH NROFF COMPATIBILITY
.I Cawf
accepts the following raw \*(Nr requests:
.ES
\&.\e" .ad .bp .br .ce .de .di .ds
\&.el .fi .fl .ft .i0 .ie .if .in
\&.it .lg .li .ll .ls .na .ne .nf
\&.nr .ns .pl .po .ps .rm .rn .rr
\&.rs .so .sp .ta .ti .tm .tr
.EE
and the following in-text codes:
.ES
\e$ \e% \e* \e" \ec \ef \eh \ek
\en \es \ew
.EE
plus the full list of \*(Nr/\c
.I troff
special characters in
the original V7 \fItroff\fR manual.
.PP
Many restrictions are present; the behavior in general is a subset of
\*(Nr's. Of particular note are the following:
.IP \(bu 2
The fully supported nroff request control character is the period.
There is limited support for the non\-break, acute accent control
character.
.PT
Point sizes do not exist;
.B .ps
is ignored.
.PT
Special vertical spacing \- the
.B .vs
request included \- is ignored.
.PT
Conditionals cover only the numeric comparisons >, =, <, >= and <= on
.BR \en(.$ ;
string com\%par\%isons between a macro parameter and a literal;
.B n
(always true);
and
.BR t
(always false).
Only single line input is accepted from conditionals;
multi\-line input \- e.g., \\(\fIanything\fP\\) \- is not supported.
.PT
The handling of strings is generally primitive.
.IP \(bu
Horizontal motion via
.B \eh
must be supplied with a number register interpolation and must be
positive - e. g.,
.BR \ew\en(NN ,
where the value in NN is >= 0.
.IP \(bu
The
.B \ek
function is reliable only after TAB characters, so it is useful only
for measuring table positions.
.IP \(bu
The
.B .di
request only turns output on and off \- any macro name is ignored.
.IP \(bu
Expressions - e. g.,
.B .sp
- are reasonably general, but the
.BR | ,
.BR & ,
and
.BR :\&
operators do not exist, there must be white space between the end of the \*(Nr
function and the beginning of the expression, and
.B \ew
requires that quote (') be used as the delimiters.
.B \ew
counts the characters inside the quotes and scales the result in ens,
so that, for example, \ew'\e(bu' equals 4n, and \ew'\e(bu'/1n equals 4.
.PT
The only acceptable count for the
.B .it
request is one,
and it is effective only with
.BR man ,
.B me
or
.B ms
macros.
.PT
The default scaling factor is `v' for the
.BR .ne ,
.BR .sp ,
and
.B .pl
raw \*(Nr requests; it is `u' for
.BR .nr ;
and `n' for
.BR .in ,
.BR .ll ,
.BR .ls ,
.BR .po ,
.BR .ta
and
.BR .ti .
(A different scaling factor may be specified with a trailing character.)
.PT
Some obsolete or meaningless requests \-
.BR .i0 ,
.B .lg
and
.B .li
\&\- are silently ignored.
.P
White space at the beginning of lines,
and embedded white space within lines is dealt with properly.
Sentence terminators at ends of lines are understood to imply
extra space afterward in filled lines.
Tabs are im\%plemented crudely and not exactly, although
usually they work as expected.
Hyphenation is done only at explicit hyphens, em-dashes, and \*(Nr
discretionary hyphens.
By default bold and italic characters are emulated with backspacing and
overprinting, but the
.B \-d
and
.B \-f
options, combined with the contents of the device configuration file,
may be used to generate special codes for bold and italic characters.
(See the
.B DEVICES
section for more information.)
.SH "MAN MACROS"
The
.B man
macro set replicates the full V7 manual macros,
plus a few semi-random oddballs.
The full list is:
.ES
\&.AT .B .BI .BR .BY .DE .DT .HP
\&.I .IB .IP .IR .IX .LP .NB .P
\&.PD .PP .RB .RE .RI .RS .SH .SM
\&.SS .TH .TP .UC
.EE
.B .BY
and
.B .NB
each take a single string argument (respectively, an indi\%cation of
authorship and a note about the status of the manual page) and arrange
to place it in the page footer.
.B .AT
and
.B .IX
do nothing.
.SH "ME MACROS"
The
.B me
macro subset has been derived from the
.I cawf
.B ms
macros by Chet Creider <creider@csd.uwo.ca>.
It includes:
.ES
\&.(l .(q .)l .)q .b .bu .i .ip
\&.lp .np .pp .r .sh .sm .u .uh
.EE
The .(l C and .(l L options are supported.
In addition, the .AB, .AE, .AI, .AU, .DA, .ND, .TL and .UX macros have
been retained from the
.B ms
set, and the .XP macro has been borrowed from the Berkeley additions to the
.B ms
macro set.
.SH "MS MACROS"
The
.B ms
macro set is a substantial subset of the V7 manuscript macros.
The macros are:
.ES
\&.AB .AE .AI .AU .B .CD .DA .DE
\&.DS .I .ID .IP .LD .LG .LP .ND
\&.NH .NL .PP .QE .QP .QS .R .RE
\&.RP .RS .SH .SM .TL .TP .UL .UX
.EE
Size changes are recognized but ignored, as are
.B .RP
and
.BR .ND .
.B .UL
just prints its argument in italics.
.BR .DS / .DE
does not do a keep,
nor do any of the other macros that normally imply keeps.
.LP
The
.B DY
string variable is available.
The
.BR PD ,
.BR PI ,
and
.BR LL
number registers exist and can be changed.
.SH "HEADERS AND FOOTERS"
.I Cawf
allows the placement of text into the five line header and
footer sections from the
.BR LH ,
.BR CH ,
.BR RF ,
.BR LF ,
.BR CF ,
and
.B RF
string variables, via the control of the
.B .^b
request:
.LP
.ta \w'.^b HF 0'u+3n
.nf
\&.^b fh 1 enables header string placement on the first page
\&.^b fh 0 disables header string placement on the first page
\&.^b HF 1 enables header/footer string placement
\&.^b HF 0 disables header/footer string placement
.fi
.LP
There are appropriate
.B .^b
requests in the distribution
.BR man ,
.B me
and
.B ms
macro files.
(The
.B me
and
.B ms
macro files use another
.B .^b
request, \fB.^b NH\fP, to enable numbered header processing.)
.SH OUTPUT
The default output format supported by
.IR cawf ,
in its distributed form,
is that appropriate to a dumb terminal,
using overprinting for italics (via underlining) and bold.
The \*(Nr special characters are printed as some vague approximation
(it's sometimes extremely vague) to their correct appearance.
.PP
One part of
.IR cawf 's
knowledge of the output device, related to the formation of characters,
is established by a device file, which is read before the user's input.
The search for it begins in
.IR cawf 's
library directory, under the name \fIterm\fP.\fBdev\fP
(where \fIterm\fR is the value of the TERM environment variable).
Failing to find that,
.I cawf
searches for
.BR dumb.dev .
(See the
.B FILES
section for a description of the path to
.IR cawf 's
library directory.)
The device file
uses special internal requests
to set up resolution, special characters
and more normal \*(Nr functions to set up page length, etc.
.PP
.I Cawf
has limited support for fonts special forms of bold and italic characters.
It is provided through the
.B \-c
.IR config ,
.BI \-d device
and
.BI \-f font
options.
See the
.B DEVICES
section for more information.
.PP
Note the distinction between the device and the output device configuration
files.
The device file typically defines characters and constant output parameters.
The output device configuration file defines font and type face codes.
It is usually not necessary to define a separate device file for each
device represented in the output device configuration file \- the
.I dumb.dev
device file will suffice for almost all representations.
.SH DEVICES
.I Cawf
supports primitive output device configuration for font and type face
control.
One font may be selected for the entire document by directing
.I cawf
to issue a font selection control character string at the beginning
of the document, and control character strings may be selected for
switching between the bold, italic and Roman type faces.
.PP
The
.B \-c
.IR config,
.BI \-d device
and
.BI \-f font
options direct the font and type face selections.
.PP
The
.BI \-d device
option specifies the name of the device.
.I Cawf
has three built\-in devices \- ANSI, NONE and NORMAL.
When the ANSI device is selected,
.I cawf
issues the ANSI shadow mode control codes, ``ESC [ 7 m'', to represent
the bold face;
the ANSI underscore control codes, ``ESC [ 4 m'', to represent the italic
face;
and the ANSI control codes, ``ESC [ 0 m'', to represent the ROMAN face.
No
.BI \-f font
specification is permitted with the ANSI device.
.PP
When the NONE device is selected,
.I cawf
uses no special output codes to represent the type faces.
No
.BI \-f font
specification is permitted with the ANSI device.
.PP
The NORMAL output device is the default.
When it's selected,
.I cawf
overprints each bold character two times, using three issuances of each
bold character, separated by backspace characters;
it issues an underscore and backspace before each italic character.
No
.BI \-f font
specification is permitted with the ANSI device.
The
.IR bsfilt (1)
filter may be used to further process the backspace codes output for
a NORMAL device.
.PP
All other devices named in the
.BI \-d device
option must be represented by a stanza in the device configuration file.
The device configuration file is usually contained in
.I device.cf
in
.IR cawf's
library directory (see the
.B FILES
section for more information).
An alternate device configuration file path may be specified with the
.BI \-c config
option.
.PP
The
.B DEVICE CONFIGURATION FILE
section describes the organization of the device configuration file.
It is easy to add devices to the
.I device.cf
supplied in the
.I cawf
distribution.
.PP
The
.BI \-f font
option may be used with the
.BI \-d device
option, when the appropriate stanza in the device configuration file
contains an entry for the named
.IR font .
The
.B DEVICE CONFIGURATION FILE
section describes how fonts are defined in device configuration file
stanzas.
.SH DEVICE CONFIGURATION FILE
The device configuration file defines the special character codes
necessary to direct output devices to select fonts and to produce
bold, italic and Roman type faces.
.PP
The configuration file is usually found in
.I device.cf
in
.IR cawf 's
library directory (see the
.B FILES
section for more information).
It is organized into two main parts \- comments and device stanzas.
Comments are any lines that begin with the pound sign (`#') character.
They are informational only and
.I cawf
ignores them.
.I Cawf
also ignores empty lines, so they may be used as vertical white space.
.PP
Stanzas name devices and define their font and type face control strings.
A stanza begins with the name of the device, starting at the beginning
of a line and occupying the entire line.
The body of the stanza, defining fonts and type faces, is formed of
lines beginning with white space (a TAB or space characters) that
directly follow the device name.
.PP
Individual lines of the stanza body contain a key character, followed
by a equal sign, followed by the font name (if a font key) and the
output device control codes.
.I Cawf
issues the font control codes once, at the beginning of output, so
only one font may be selected.
The type face control codes are issued at each change of type face.
.PP
The key characters are:
.ne 4
.PP
.RS
.nf
b for bold
f for font definition
i for italic
r for Roman
.fi
.RE
.PP
The `b', `i' and `r' key codes are followed by an equal sign (`=') and
their control code definition.
The `f' key code is followed by an equal sign (`='), the font name,
another equal sign and the font control code definition.
.PP
Control code definitions may contain any printable ASCII characters.
Non\-printable characters may be encoded in octal notation with the `\\nnn'
form or in hexadecimal with the `\\xnn' form.
The special code, `\\E' (or `\\e') represents the ESC control
character (\\033 or \\x1b).
.PP
Here's a sample showing the definition for the HP LaserJet III.
The stanza name is ``lj3''.
All its non\-printable characters are ESCs; the first is coded in
octal form; the second with '\\E'; the rest, in hexadecimal form.
TAB is used as the leading white space character for the stanza
body lines.
.PP
.RS
.nf
# HP LaserJet III
lj3
b=\\033(s7B
i=\\E(s1S
r=\\x1b(s0B\\x1b(s0S
f=c10=\x1b&l0O\x1b(8U\x1b(s0p12h10v0s0b3T
f=c12ibm=\x1b&l0O\x1b(10U\x1b(s0p10.00h12.0v0s0b3T
f=lg12=\x1b&l0O\x1b(8U\x1b(s12h12v0s0b6T
.fi
.RE
.PP
The distribution
.I device.cf
file defines the following devices and fonts.
.LP
.ta \w'kxp1180'u+3n +\w'Italic:'u+3n +\w'bps10'u+6n
.nf
.ne 3
epson dot matrix printer in Epson FX-86e/FX-800 mode
Bold: Double-strike
Fonts: none
.ne 4
ibmppds IBM Personal Printer Data Stream (PPDS) protocol
Bold: Double-strike
Italic: Underline
Fonts: none
.ne 12
kxp1124 Panasonic KX\-P1124 dot matrix printer in PGM mode
Bold: Emphasized
Fonts: c10 10 Characters Per Inch (CPI) Courier
c12 12 CPI Courier
bps10 10 CPI Bold PS
bps12 12 CPI Bold PS
p10 10 CPI Prestige
p12 12 CPI Prestige
s10 10 CPI Script
s12 12 CPI Script
ss10 10 CPI Sans Serif
ss12 12 CPI Sans Serif
.ne 10
kxp1180 Panasonic KX\-P1180 dot matrix printer in PGM mode
Bold: Emphasized
Fonts: c10 10 Characters Per Inch (CPI) Courier
c12 12 CPI Courier
bps10 10 CPI Bold PS
bps12 12 CPI Bold PS
p10 10 CPI Prestige
p12 12 CPI Prestige
ss10 10 CPI Sans Serif
ss12 12 CPI Sans Serif
.ne 6
lj3 HP LaserJet III
Fonts: c10 10 point, 12 Characters Per Inch (CPI)
Courier
c12ibm 12 point, 10 CPI Courier, IBM\-PC
Symbol Set
lg12 12 point, 12 CPI Letter Gothic
.ne 4
vgamono VGA monochrome monitor for MS\-DOS
(ANSI.SYS driver required for MS\-DOS)
Italic: Reverse-video
Fonts: none
.SH FILES
.I Cawf
resource files are located in the
.I cawf
library directory \- \fI C:\\SYS\\LIB\\CAWF\fP, the MS\-DOS environment
default;
or
.IR /usr/lib/cawf ,
the UNIX environment default.
These defaults can be overridden by the CAWFLIB environment variable,
or changed in the cawflib.h header file.
.ta \w'device.cf'u+3n
.nf
common common device-independent initialization
device.cf output device configurations
*.dev device-specific initialization
m*.mac macro package files
.SH DIAGNOSTICS
Unlike
.IR nroff ,
.I cawf
complains whenever it sees unknown requests.
All diagnostics appear on the standard error file.
.ad
.SH HISTORY
Vic Abell of Purdue University <abe@cc.purdue.edu> derived
.I cawf
from
.IR awf ,
\&``the Amazingly Workable (text) Formatter,''
written by Henry Spencer of the University of Toronto.
The Toronto work was a supplement to the C News project.
The Purdue effort was aimed at producing a C language version that
would run on small systems, particularly MS\-DOS ones.
The adaptation of the
.B me
macros was done by Chet Creider <creider@csd.uwo.ca>.
Chet also contributed ideas for device, font and type face support.
.PP
The MS\-DOS version of
.I cawf
has been compiled with version 2.5 of Microsoft's Quick-C compiler.
It runs under the Mortis Kern Systems Toolkit KornShell,
.IR ksh (1),
and COMMAND.COM.
.SH BUGS
Nroff and troff mavens will have many complaints.
Some may even represent bugs and not deliberate omissions.
.PP
Watch out for scaling factors - especially on requests like
.BR \ew .
.PP
The overprinting required to create bold and italicized characters is
tiresome on a slow printer.
The
.IR bsfilt (1)
post\-filter from this distribution may be used to alleviate that
nuisance by managing the backspacing codes from
.IR cawf 's
NORMAL device output.
.PP
The printing of bold and italic characters is sometimes better handled by
special printer codes.
Use
.IR cawf 's
.B \-c
.IR config ,
.BI \-d device
and
.BI \-f font
options to produce special font and device output control codes.
.PP
.I Cawf
has a small amount of built-in code for the
.BR man ,
.B me
and
.B ms
macro packages, but none for any others.
.PP
The stacking for the
.B .so
request is limited.
.SH SEE ALSO
bsfilt(1),
colcrt(1),
man(7),
me(7),
ms(7)
and
nroff(1).

588
man/man1/cc.1 Normal file
View file

@ -0,0 +1,588 @@
.TH CC 1
.SH NAME
cc, pc, m2 \- Minix C, Pascal, and Modula-2 compilers
.SH SYNOPSIS
.in +.5i
.ti -.5i
.BR cc |\c
.BR pc |\c
.BR m2
.RB [ "\-D \fIname\fR[\fB=\fIvalue" ]]
\&...
.RB [ "\-U \fIname" ]
\&...
.RB [ "\-I \fIdirectory" ]
\&...
.RB [ \-.\fIsuffix ]
\&...
.RB [ \-c ]
.RB [ \-E ]
.RB [ \-P ]
.RB [ \-S ]
.RB [ \-c.\fIsuffix ]
.RB [ \-O ]
.RB [ \-O\fIlevel ]
.RB [ \-OS ]
.RB [ \-OT ]
.RB [ \-g ]
.RB [ \-n ]
.RB [ \-a ]
.RB [ \-R ]
.RB [ \-A ]
.RB [ \-s ]
.RB [ \-fsoft ]
.RB [ \-fnone ]
.RB [ \-w ]
.RB [ \-wo ]
.RB [ \-ws ]
.RB [ \-wa ]
.RB [ \-3 ]
.RB [ \-_ ]
.RB [ \-W\fIname\fB\-\fIoption ]
\&...
.RB [ \-m\fIarch ]
.RB [ "\-o \fIoutfile" ]
.RB [ "\-L \fIdirectory" ]
\&...
.RB [ \-i ]
.RB [ \-sep ]
.RB [ \-com ]
.RB [ \-r ]
.RB [ "\-stack \fIsize" ]
.I operand
\&...
.sp .4v
.ti -.5i
(Minix-86 subset:)
.ti -.5i
.BR cc |\c
.BR pc |\c
.BR m2
.RB [ "\-D\fIname\fR[\fB=\fIvalue" ]]
\&...
.RB [ "\-U\fIname" ]
\&...
.RB [ "\-I\fIdirectory" ]
\&...
.RB [ \-.o ]
\&...
.RB [ \-c ]
.RB [ \-E ]
.RB [ \-P ]
.RB [ \-S ]
.RB [ \-c.\fIsuffix ]
.RB [ \-O ]
.RB [ \-O\fIlevel ]
.RB [ \-n ]
.RB [ \-a ]
.RB [ \-R ]
.RB [ \-A ]
.RB [ \-s ]
.RB [ \-f ]
.RB [ \-w ]
.RB [ \-wo ]
.RB [ \-ws ]
.RB [ \-wa ]
.RB [ \-3 ]
.RB [ \-_ ]
\&...
.RB [ \-m ]
.RB [ "\-o \fIoutfile" ]
.RB [ "\-L\fIdirectory" ]
\&...
.RB [ \-i ]
.RB [ \-sep ]
.RB [ \-com ]
.I operand
\&...
.in -.5i
.SH DESCRIPTION
.BR Cc ,
.BR pc ,
and
.BR m2
are the call names of the Minix C, Pascal, and Modula-2 compilers from
the Amsterdam Compiler Kit (ACK).
.PP
All these call names are links to the
.B acd
driver program.
.B Acd
uses the driver description file
.B /usr/lib/descr
that describes the steps necessary to compile a source file. The
.BR acd (1)
manual page describes a few more flags, like
.BR \-v ,
that may be useful for debugging compiler problems.
.PP
Minix-86 uses a C program as the compiler driver. This driver is not as
flexible as the one implemented with the
.B acd
driver, and offers a smaller number of options. The second line of
the synopsis above shows the options that the Minix-86 driver supports. The
rest of this manual page is geared towards the
.B acd
driver. People writing software for Minix-86, or that should be
portable to all Minix versions should stick to the options listed under
the Minix-86 compiler.
.SH OPTIONS
The transformations done by the compiler are modified by the following
options. They are a superset of the options required by \s-2POSIX\s+2,
with the Minix or compiler specific ones are marked as such. Options
for one specific compiler are ignored for others. Read the OPTIONS section
of
.BR acd (1)
for the driver specific options.
.PP
.TP
.BI \-D " name\fR[\fB=\fIvalue\fR]"
Same as if
.BI #define " name value"
had been given.
.B 1
is assumed if
.I value
is omitted. This argument, like all the other double arguments, may also
be given as a single argument. (I.e. either as
.BI \-D "\0name"
or
.BI \-D name\fR.)
(The Minix-86 driver is not so flexible, the proper form can be seen in
the synopsis.)
.TP
.BI \-U " \fIname"
Undefine the pre-defined symbol
.IR name .
.TP
.BI \-I " directory"
Extend the include directory path with the given directory. These
directories are searched for include files in the given order before the
standard places. The standard place for the C compiler is
.BR /usr/include ,
and for the Modula-2 compiler it is
.BR /usr/lib/m2 .
.TP
.BI \-. suffix
Act as if a source file with the given suffix is present on the command line.
For each language found on the command line the appropriate libraries are
selected. The first language mentioned selects the runtime startoff.
The call name of the driver also chooses the language, so \fBcc\fP is an
implicit
.BR \-.c .
The runtime startoff can be omitted by specifying
.B \-.o
for those rare cases where you want to supply your own startoff. (Minix)
.TP
.B \-c
Transform the input files to object files and stop. The
.B \-o
option may be used under Minix to set the name of the object file.
.BR Make (1)
likes this, because
.BI "cc \-c" " dir/file" .c
puts
.IB file .o
in the current directory, but
.BI "cc \-c" " dir/file" .c
.BI \-o " dir/file" .o
puts the
.B .o
file where
.B make
expects it to be by its builtin
.B .c.o
rule.
(Minix-86 can only use
.B \-o
to name an executable.)
.TP
.B \-E
Run the preprocessor over the input files and send the result to standard
output or the file named by
.BR \-o .
Standard input is read if an input file is named "\fB\-\fR".
.TP
.B \-P
Run the preprocessor over the input files and put the result to files
with the suffix
.BR .i .
File and line number information is omitted from the output. Use
.B \-P \-E
under Minix to omit this info for
.B \-E
too.
.TP
.B \-S
Transform the input files to assembly files with suffix
.BR .s .
.TP
.BI \-c. suffix
Transform the input files to files with the given suffix. This can only
succeed if there is a valid transformation from the input file to the
given suffix. The same goes for
.B \-c
and other options that are just special cases of this option, except for
.BR \-P ,
.B \-c.i
keeps the line number info. The option
.B \-c.a
makes the driver transform the input files to object files and add them to a
library. (So you do not need to know how the archiver works.) Note that you
need to give object files as arguments if you want to replace old object
files. Transformed files are added under a (unique) temporary name. With
.B \-o
you can name the library. (Minix) (Minix-86 can't do
.BR \-c.a .)
.TP
.B \-O
Optimize code. This option is a no-op, because all the compilers already
use the
.BR \-O1
optimization level to get code of reasonable quality. Use
.BR \-O0
to turn off optimization to speed up compilation at debug time.
.TP
.BI \-O level
Compile with the given optimization level. (Minix)
.PP
.B \-OS
.br
.B \-OT
.RS
Optimize for space or for time. (Minix)
.RE
.TP
.B \-g
Compile the C source with debugging information. (The way
.BR \-g ,
.B \-s
and
.B \-O
interact is left unspecified.)
.TP
.B \-n
Omit the file and line number tracking that is used for runtime error reports
from Pascal or Modula-2 programs. The
.B \-n
flag is normally used to compile library modules, but may also be useful to
make a program smaller and faster once debugged. (Pascal & Modula-2)
.TP
.B \-a
Enable assertions, i.e. statements of the form \fBassert\fI\ test\fR
that cause a descriptive runtime error if the boolean expression
.I test
evaluates false. (Pascal & Modula-2)
.TP
.B \-R
Disable runtime checks like overflow checking. (Pascal & Modula-2)
.TP
.B \-A
Enable array bound checks. (Pascal & Modula-2)
.TP
.B \-s
Strip the resulting executable of its symbol table.
.PP
.B \-fsoft
.br
.B \-f
.RS
Use software floating point instead of hardware floating point. This is
a loader flag, but in general it is best to specify this flag in all
phases of the compilation. (Minix)
.RE
.TP
.B \-fnone
Ignored. Used under Minix-vmd to omit floating point printing/scanning
code. The standard Minix compiler figures this out automatically using
a special loader trick. (Minix)
.TP
.B \-w
Do not produce warnings about dubious C language constructs. Normally
the compiler is configured to do the maximum amount of checking
without being too annoying. (Minix)
.TP
.B \-wo
Omit warnings about old (K&R) style. (Minix)
.TP
.B \-ws
Omit strict warnings. (Minix)
.TP
.B \-wa
Omit all warnings. (Minix)
.TP
.B \-3
Only accept 3rd edition Modula-2. (Modula-2)
.TP
.B \-_
Allow underscores in Pascal or Modula-2 identifiers, but not at the beginning
of an identifier. (Pascal & Modula-2)
.TP
.BI \-W name \- option
If
.I name
is the name of the compiler this driver is working for, then
.I option
is activated for that compiler. See below for a per-compiler list. Any other
.B \-W
option is ignored. (\fB\-W\fP is described by \s-2POSIX\s+2 as an optional
flag to send options to the different compiler passes with a totally
different (and nicely ignored) syntax as described here.) (Minix-86 ignores
any
.B \-W
flag.)
.TP
.B \-m
Under Minix-86 this option transforms the function declarations (prototypes)
to the old K&R form, i.e. the arguments declarations are removed. This saves
a lot of memory in the compiler and may allow a large program to be compiled.
One must make sure that function arguments are properly type-cast where
necessary. (Minix)
.TP
.BI \-m arch
Set the target architecture for a cross compiler. Normally the compiler
produces code for the same architecture it itself is compiled for. The
.B ARCH
environment variable may also be used to set the architecture. Architectures
names are:
.B i86
(Intel 8086 and 286),
.B i386
(Intel 386, 486, ...),
.B m68000
(Motorola MC68000 & MC68010, 16-bit ints),
.B m68010
(Motorola MC68000 & MC68010, 32-bit ints),
.B m68020
(Motorola MC68020, 32-bit ints),
.B sparc
(Sun SPARC). (Minix) (Ignored under Minix-86.)
.TP
.BI \-o " outfile"
Set the output file for the
.BR \-c ,
.BR \-c.a ,
and
.BR \-E
options, or choose the executable name instead of the default
.BR a.out .
(Minix-86 can only choose the executable name.)
.TP
.BI \-L " directory"
Extend the library search path with
.IR directory .
These directories are searched for libraries named by
.B \-l
in the given order before the standard places. The standard places are
.B /lib/\c
.IR arch ,
and
.B /usr/lib/\c
.IR arch .
The search for libaries in directories added with
.B \-L
looks in
.IB directory /\c
.IR arch
and
.I directory
itself.
.RI ( Arch
is the machine architecture name. This is
Minix dependent, compilers on other systems usually only look in
.IR directory .)
(Minix-86 only has
.B /lib
and
.B /usr/lib
as the standard places.)
.PP
.B \-sep
.br
.B \-com
.RS
Create a Separate I&D or a common I&D executable. The text segment of a
separate I&D executable is read-only and shareable. For an
.B i86
binary this also means that the text and data segment can each be 64
kilobytes large instead of just 64 kilobytes together. Separate I&D is the
default. Common I&D is probably only useful for the bootstraps. The
.B \-i
option has the same meaning as
.BR \-sep ,
but should no longer be used.
(Minix)
.RE
.TP
.B \-r
Makes the loader produce a relocatable object file, i.e. a file that
may be loaded again. The runtime startoff and the default libraries are
omitted, only the files mentioned are combined. (Minix)
.TP
.BI \-stack " size"
Allow the process
.I size
bytes of heap and stack.
.I Size
is a C-style decimal, octal, or hexadecimal number, optionally followed by
the multipliers
.BR m ,
.BR k ,
.BR w ,
and
.B b
for mega (1024*1024), kilo (1024), "word" (2 or 4), and byte (1). Uppercase
letters are accepted too. A size of
.B 32kw
is used by default, translating to 64k for
.BR i86 ,
and 132k for other architectures. Too large a size is rounded down to keep
the data segment within 64 kilobytes for the
.BR i86 .
(Minix)
.SH OPERANDS
All leftover operands are treated as files to be compiled, with one
exception. The construct
.BI \-l " library"
is used to denote a library, usually
.BI lib library .a\fR,
that is to be searched in the directories mentioned with
.B \-L
or the standard places. These libraries keep their place among the
(transformed) input files when presented to the loader. (It is a common
mistake to write
.BR "cc\ \-lcurses\ x.c"
instead of
.BR "cc\ x.c\ \-lcurses" .)
.SH IMPLEMENTATION
The Minix compiler implementation uses the ACK compilers adapted for use
under Minix as described below. Read
.BR ACK (7)
for more detailed information on the ACK compilers themselves.
.SS "Feature test macros"
The preprocessors are given these arguments to define feature test macros:
.B \-D__ACK__
tells what compiler is used.
.B \-D__minix
tells that this is Minix.
.BI \-D__ arch
tells the architecture.
(More macros are defined, but they are only to be used in the include files.)
.PP
The symbols above are predefined by the preprocessor so that your program is
able to "sense" the environment it is in. It is also possible for your
program to do the opposite, to tell what kind of environment it likes to
have. By default,
.B cc
compiles a standard C program. If you want the extensions described in
POSIX.1 to become visible, then you have to set
.BR _POSIX_SOURCE " to " 1
at the start of your program.
To enable \s-2UNIX\s+2 or Minix extensions you need to also set
.BR _MINIX " to " 1 .
If you don't want to clutter your source files with these symbols then you
can use
.B cc \-D_MINIX \-D_POSIX_SOURCE
to get the POSIX.1 and the Minix extensions.
.SS "Preprocessing"
Pascal, Modula-2, EM source (see below), and Assembly source are
preprocessed by the C preprocessor if the very first character in the file
is a '\fB#\fP' character.
.SS "Assembly dialects"
No two compilers use the same assembly language. To be able to use the same
assembly dialect for the low level support routines an assembly converter is
provided. The input of this converter can be of type
.BR ack ,
.BR ncc ,
or
.BR bas ,
and the output can be of type
.BR ack ,
.BR ncc ,
or
.BR gnu .
The suffix of the file tells the assembly dialect (see below), or one can
use the option
.BI \-Was\- dialect
to tell the driver what the dialect of a plain
.B .s
file is. The assembly converter is not as smart as the assembler, the
translation is more or less a text substitution. It leaves a lot of
checking to the target assembler. You have to restrict yourself to a subset
that is understood by both assemblers. The ACK assembler for instance
doesn't care if you use `ax' or `eax' for a 32 bit register, it looks at the
instruction type. The GNU assembler doesn't like this, so you have to use
the proper register name in ACK assembly that is to be translated to GNU
assembly. Expressions are converted as is, even if the operator precedence
rules of the two assembly languages differ. So use parentheses. The
converter does promise one thing: compiler output can be properly
translated. (Note that under Minix-86
.B \-W
is ignored. All assembly should therefore be in the "ncc" dialect.)
.SH FILES
.TP 10
.B /usr/lib/descr
The compiler description file.
.TP
.B .c
Suffix of a C source file.
.TP
.B .mod
Modula-2.
.TP
.B .p
Pascal.
.TP
.B .i
Preprocessed C source.
.TP
.B .k
ACK machine independent compact EM code produced by the C, Pascal, or
Modula-2 front end (or any other ACK front end.) The ACK compilers are
based on the UNCOL idea where several front ends compile to a common
intermediate language, and several back ends transform the intermediate
language to the target machine language. The ACK intermediate language
is named "EM".
.TP
.B .m
Peephole optimized EM.
.TP
.B .gk
Result of the (optional) EM global optimizer.
.TP
.B .g
Result of the second EM peephole optimizer used after the global optimizer.
.TP
.B .e
Human readable EM. (Human created or decoded compact EM.)
.TP
.B .s
Target machine assembly. (Current compiler dialect.)
.TP
.B .ack.s
ACK assembly.
.TP
.B .ncc.s
ACK Xenix style assembly. This dialect is used by the 16 bit ACK ANSI C
compiler.
.TP
.B .gnu.s
GNU assembly.
.TP
.B .bas.s
BCC assembly. (Used by the Bruce Evans' BCC compiler, for many years the
compiler for Minix-386.)
.TP
.B .o
Object code.
.TP
.B .a
Object code library.
.TP
.B a.out
Default output executable.
.SH "SEE ALSO"
.BR acd (1),
.BR ACK (7).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

31
man/man1/cdiff.1 Normal file
View file

@ -0,0 +1,31 @@
.TH CDIFF 1
.SH NAME
cdiff \- context diff
.SH SYNOPSIS
\fBcdiff\fR [\fB\-c\fIn\fR] \fIoldfile \fInewfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-c" "Provide \fIn\fR lines of context"
.SH EXAMPLES
.EX "cdiff old new >f" "Write context diff on \fIf\fR"
.EX "cdiff \-c1 old new >f" "Use only 1 line of context"
.SH DESCRIPTION
.PP
\fICdiff\fR produces a context diff by first running \fIdiff\fR and then
adding context.
Some update programs, like \fIpatch\fR, can use context diffs to update
files, even in the presence of other, independent changes.
.SH "SEE ALSO"
.BR cmp (1),
.BR diff (1),
.BR patch (1).

33
man/man1/cgrep.1 Normal file
View file

@ -0,0 +1,33 @@
.TH CGREP 1
.SH NAME
cgrep \- grep and display context
.SH SYNOPSIS
\fBcgrep\fR [\fB\-a \fIn\fR]\fR [\fB\-b \fIn\fR] [\fB\-f\fR] [\fB\-l \fIn\fR] [\fB\-n\fR] [\fB\-w \fIn\fR] \fIpattern\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-a" "How many lines to display after the matching line"
.FL "\-b" "How many lines to display before the matching line"
.FL "\-f" "Suppress file name in the output"
.FL "\-l" "Lines are truncated to this length before comparison"
.FL "\-n" "Suppress line numbers in the output"
.FL "\-w" "Sets window size (same as \fB\-a\fR n \fB\-b\fR n)"
.SH EXAMPLES
.EX "cgrep \-w 3 hello file1" "Print 3 lines of context each way"
.SH DESCRIPTION
.PP
\fICgrep\fR is a program like \fIgrep\fR, except that it also can print
a few lines above and/or below the matching lines.
It also prints the line numbers of the output.
.SH "SEE ALSO"
.BR grep (1),
.BR fgrep (1).

38
man/man1/chgrp.1 Normal file
View file

@ -0,0 +1,38 @@
.TH CHGRP 1
.SH NAME
chgrp \- change group
.SH SYNOPSIS
\fBchgrp [\fB\-R\fR] [\fIowner:\fR]\fIgroup \fIfile\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-R" "Change directory hierarchies"
.SH EXAMPLES
.EX "chgrp system file1 file2" "Make \fIsystem\fR the group of the files"
.EX "chrgp \-R other dir1" "Make \fIother\fR the group of all files below dir1"
.SH DESCRIPTION
.PP
The group field (and optionally owner field) of the named files is changed to
.I group
and
.I owner .
Alternatively, a decimal gid (uid) may be specified instead of a group name.
If the \fB\-R\fR flag is used, the changes will be applied recursively to
all files in named directories. Only the superuser may execute this command
to set arbitrary groups. Normal users can only change the group if they own
the file, and the group is their own group (Minix), or one of their
supplementary groups (Minix-vmd).
.SH "SEE ALSO"
.BR chown (8),
.BR chmod (1),
.BR ls (1),
.BR chown (2).

65
man/man1/chmem.1 Normal file
View file

@ -0,0 +1,65 @@
.TH CHMEM 1
.SH NAME
chmem \- change memory allocation
.SH SYNOPSIS
\fBchmem\fR [\fB+\fR]\fR [\fB\-\fR] [\fB=\fR] \fIamount file\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "chmem =50000 a.out" "Give \fIa.out\fP 50K of stack space"
.EX "chmem \-4000 a.out" "Reduce the stack space by 4000 bytes"
.EX "chmem +1000 file1" "Increase each stack by 1000 bytes"
.SH DESCRIPTION
.PP
When a program is loaded into memory, it is allocated enough memory
for the text and data+bss segments, plus
an area for the stack.
Data segment growth using
.I malloc ,
.I brk ,
or
.I sbrk
eats up stack space from the low end.
The amount of stack space to allocate is derived
from a field in the executable program's file header.
If the combined stack and data segment growth exceeds the stack space
allocated, the program will be terminated.
.PP
It is therefore important to set the amount of stack space carefully.
If too little is provided, the program may crash.
If too much is provided, memory will be wasted, and fewer programs will be able
to fit in memory and run simultaneously.
\s-2MINIX\s+2
does not swap, so that when memory is full, subsequent attempts to fork will
fail.
The compiler sets the stack space
to the largest possible value (for the Intel CPUs, 64K \- text \- data).
For many programs, this value is far too large.
Nonrecursive programs that do not call
.I brk ,
.I sbrk ,
or
.I malloc ,
and do not have any local arrays usually do not need more than 8K of stack
space.
.PP
The
.I chmem
command changes the value of the header field that determines the stack allocation, and
thus indirectly the total memory required to run the program.
The = option sets the stack size
to a specific value; the + and \- options increment and decrement the
current value by the indicated amount.
The old and new stack sizes are printed.
.SH "SEE ALSO"
.BR install (1),
.BR brk (2).

62
man/man1/chmod.1 Normal file
View file

@ -0,0 +1,62 @@
.TH CHMOD 1
.SH NAME
chmod \- change access mode for files
.SH SYNOPSIS
\fBchmod [\fB\-R\fR] \fImode \fIfile\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-R" "Change hierarchies recursively"
.SH EXAMPLES
.EX "chmod 755 file" "Owner: rwx Group: r\-x Others: r\-x"
.EX "chmod +x file1 file2" "Make \fIfile1\fR and \fIfile2\fR executable"
.EX "chmod a\-w file" "Make \fIfile\fR read only"
.EX "chmod u+s file" "Turn on SETUID for \fIfile\fR"
.EX "chmod \-R o+w dir" "Allow writing for all files in dir"
.SH DESCRIPTION
.PP
The given mode is applied to each file in the file list. If the \fB\-R\fR
flag is present, the files in a directory will be changed as well.
The mode can be either absolute or symbolic. Absolute modes are given as an
octal number that represents the new file mode. The mode bits are defined as
follows:
.ta 0.25i
.nf
.PP
4000 Set effective user id on execution to file's owner id
2000 Set effective group id on execution to file's group id
0400 file is readable by the owner of the file
0200 writeable by owner
0100 executable by owner
0070 same as above, for other users in the same group
0007 same as above, for all other users
.PP
.fi
Symbolic modes modify the current file mode in a specified way. The form is:
.PP
[who] op permissions { op permissions ...} {, [who] op ... }
.PP
The possibilities for \fIwho\fR are \fIu\fR, \fIg\fR, \fIo\fR, and \fIa\fR,
standing for user, group, other and all, respectively.
If \fIwho\fR is omitted, \fIa\fR is assumed, but the current umask is used.
The op can be \fI+\fR, \fI-\fR, or \fI=\fR; \fI+\fR turns on the
given permissions, \fI\- \fRturns them off; \fI=\fR sets the permissions
exclusively for the given \fIwho\fR.
For example \fIg=x\fR sets the group permissions to \fI--x\fR.
.PP
The possible permissions are \fIr\fR, \fIw\fR, \fIx\fR; which stand for read,
write, and execute; \fIs\fR turns on the set effective user/group id bits.
\fIs\fR only makes sense with \fIu\fR and \fIg\fR;\fR o+s\fR is
harmless.
.SH "SEE ALSO"
.BR ls (1),
.BR chmod (2).

34
man/man1/cksum.1 Normal file
View file

@ -0,0 +1,34 @@
.TH CKSUM 1
.SH NAME
cksum \- display file checksum and size
.SH SYNOPSIS
\fBcksum \fR[\fIfile\fR ...]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "cksum" "Display CRC and size of \fIstdin\fR"
.EX "cksum *.c" "Display CRC and size of \fI.c\fP files"
.SH DESCRIPTION
.PP
.I Cksum
calculates and writes to standard output the 32-bits CRC of the input
.I files ,
or of stdin if no
.I files
were specified. The size in bytes of each
.I file
will be displayed after a space. The name of each
.I file
will be displayed after another space.
.SH "SEE ALSO"
.BR crc (1),
.BR sum (1).

17
man/man1/clear.1 Normal file
View file

@ -0,0 +1,17 @@
.TH CLEAR 1
.SH NAME
clear, clr \- clear the screen
.SH SYNOPSIS
.B clear
.br
.B clr
.SH DESCRIPTION
.B Clear
or its synonym
.B clr
clears the screen. It is exactly equivalent to
.BR "tget -str cl" .
.SH "SEE ALSO"
.BR tget (1).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

34
man/man1/cmp.1 Normal file
View file

@ -0,0 +1,34 @@
.TH CMP 1
.SH NAME
cmp \- compare two files
.SH SYNOPSIS
\fBcmp\fR [\fB\-ls\fR] \fIfile1 file2\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-l" "Loud mode. Print bytes that differ (in octal)"
.FL "\-s" "Silent mode. Print nothing, just return exit status"
.SH EXAMPLES
.EX "cmp file1 file2" "Tell whether the files are the same"
.EX "cmp \-l file1 file2" "Print all corresponding bytes that differ"
.SH DESCRIPTION
.PP
Two files are compared.
If they are identical, exit status 0 is returned.
If they differ, exit status 1 is returned.
If the files cannot be opened, exit status 2 is returned.
If one of the file arguments is \-, then
\fIstdin\fR is compared to
the other file.
.SH "SEE ALSO"
.BR comm (1),
.BR diff (1).

39
man/man1/comm.1 Normal file
View file

@ -0,0 +1,39 @@
.TH COMM 1
.SH NAME
comm \- print lines common to two sorted files
.SH SYNOPSIS
\fBcomm\fR [\fB\-123\fR] \fIfile1 file2\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-1" "Suppress column 1 (lines present only in \fIfile1\fP)"
.FL "\-2" "Suppress column 2 (lines present only in \fIfile2\fP)"
.FL "\-3" "Suppress column 3 (lines present in both files)"
.SH EXAMPLES
.EX "comm file1 file2" "Print all three columns"
.EX "comm \-12 file1 file2" "Print only lines common to both files"
.SH DESCRIPTION
.PP
Two sorted files are read and compared.
A three column listing is produced.
Files only in
.I file1
are in column 1;
files only in
.I file2
are in column 2;
files common to both files are in column 3.
The file name \- means \fIstdin\fR.
.SH "SEE ALSO"
.BR cmp (1),
.BR diff (1),
.BR sort (1).

42
man/man1/compress.1 Normal file
View file

@ -0,0 +1,42 @@
.TH COMPRESS 1
.SH NAME
compress, uncompress, zcat \- compress a file using modified Lempel-Ziv coding
.SH SYNOPSIS
\fBcompress\fR [\fB\-cdfv\fR]\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-c" "Put output on \fIstdout\fR instead of on \fIfile.Z\fR"
.FL "\-d" "Decompress instead of compress"
.FL "\-f" "Force output even if there is no saving"
.FL "\-v" "Verbose mode"
.SH EXAMPLES
.EX "compress <infile >outfile" "Compress 1 file"
.EX "compress x y z" "Compress 3 files to \fIx.Z\fR, \fIy.Z\fR, and \fIz.Z\fR"
.EX "compress \-d file.Z" "Decompress \fIfile.Z\fR to \fIfile\fR"
.SH DESCRIPTION
.PP
The listed files (or \fIstdin\fR, if none are given) are compressed
using the Ziv-Lempel algorithm. If the output is smaller than the input,
the output is put on \fIfile.Z\fR or \fIstdout\fR if no files are listed.
If \fIcompress\fR is linked to \fIuncompress\fR, the latter is the same
as giving the \fB\-d\fP flag.
Similarly, a link to \fIzcat\fR decompresses to \fIstdout\fR.
The
\s-2MINIX\s+2
version of \fIcompress\fR uses 13-bit compression.
This means that when compressing files on other systems for transmission to
\s-2MINIX\s+2,
be sure that only 13-bit compression is used.
On many systems, the default is 16-bit (too big).
.SH "SEE ALSO"
.BR tar (1).

223
man/man1/cp.1 Normal file
View file

@ -0,0 +1,223 @@
.TH CP 1
.SH NAME
cp, mv, rm, ln, cpdir, clone \- copy, move, remove, link
.SH SYNOPSIS
.B cp
.RB [ \-pifsmrRvx ]
.I file1 file2
.br
.B cp
.RB [ \-pifsrRvx ]
.IR file " ... " dir
.PP
.B mv
.RB [ \-ifsmvx ]
.I file1 file2
.br
.B mv
.RB [ \-ifsvx ]
.IR file " ... " dir
.PP
.B rm
.RB [ \-ifrRvx ]
.IR file " ..."
.PP
.B ln
.RB [ \-ifsSmrRvx ]
.I file1 file2
.br
.B ln
.RB [ \-ifsSrRvx ]
.IR file " ... " dir
.PP
.B cpdir
.RB [ \-ifvx ]
.I file1 file2
.PP
.B clone
.RB [ \-ifsSvx ]
.I file1 file2
.SH DESCRIPTION
.de SP
.if t .sp 0.4
.if n .sp
..
The utilities
.BR cp ,
.BR mv ,
.BR rm ,
and
.B ln
do basic file management: copying, renaming or moving, deletion, and
creating links. (The
.B cpdir
and
.B clone
utilities are easy to use aliases for copying or linking whole trees.
They are the same as
.B cp \-psmr
and
.BR "ln \-fmr" )
.PP
The first synopsis form of the utilities
.BR cp ,
.BR mv ,
and
.B ln
is used if only two arguments are given, and the second argument is not a
directory. The source and target file are then the two files given.
.PP
If the second synopsis form is used then the last argument must be a
directory. Each of the files is copied, moved or linked into this directory.
.PP
A file is by default copied by
.B cp
without looking at its type, so symlinks are followed and devices are opened
and read from or written to. Links between files are ignored. This
behavior can be changed by using the proper options.
.PP
The
.B mv
utility uses the
.BR rename (2)
call to rename or move files. If source and target are on different devices
however, then
.B mv
will use
.B cp \-pr
to copy the files or directory trees.
.PP
Each utility continues with the next file on errors, except on I/O errors.
.SH OPTIONS
.TP
.B \-p
Copy the file attributes like mode, owner, group and time of last
modification. Normally only the mode is copied to a new file with the file
creation mask applied. Setuid bits are cleared if setting the ownership
fails.
.TP
.B \-i
Ask if ok to overwrite, replace or remove.
.B Mv
and
.B rm
will ask this automatically if interactive and the target file is writable.
.B Cp
will fail if the target cannot be written,
.B ln
will always fail if the target exists.
.TP
.B \-f
Makes
.B cp
remove a target file before copying if it is not writable,
.B mv
removes an existing target without asking,
.B rm
does not report any errors, and
.B ln
removes an existing target file before linking. The last of
.B \-i
and
.B \-f
wins for
.B mv
if both flags are set, the other utilities do something sensible, like asking
before forcefully removing.
.TP
.B \-s
Make a symlink instead of a normal link. For utilities other than
.B ln
this flag means "copy similar". The modified time is always copied for
.B cp \-s
and the other attributes are copied if a new file is created. The normal
\s-2POSIX\s+2 required patronizing like applying the file creation mask or
clearing setuid bits is not done.
.TP
.B \-S
Make a symlink if a normal link cannot be made because source and target are
on different devices. The symlink is required to really refer back to the
source, meaning that a/b must exist in the call
.BR "ln \-S a/b c/d" ,
and that the symlink from c/d must lead back to a/b. So the symlink will be
created as if
.B "ln \-s ../a/b c/d"
was called. If the target is a full path, but the source is not then an
error will be given saying that this is "too difficult."
.TP
.B \-m
Merge trees. The first synopsis form is assumed, and the files from one
tree are merged into the other. There is no "if it's a directory the put
it into that directory" trickery here.
.TP
.BR \-r ", " \-R
Recursively copy, remove, or link. If the source is a directory then the
files in this directory are copied to similarly named files in the target
directory. Special files are copied as new special files, they are not read
or written. Symlinks are still expanded and the link structure ignored with
.BR \-R .
The
.B \-r
flag does copy symlinks as symlinks and keeps the link structure intact.
(Note that
.B \-R
is invented by \s-2POSIX\s+2 as a replacement for the classic
.B \-r
option of older copy commands that did read special files. The standard
says that
.B \-r
is implementation defined, so that's why this flag is better than
.B \-R
in this implementation of
.BR cp .)
For
.B rm
and
.B ln
both flags mean the same.
.B Ln
will recursively link the files in the trees, except symlinks, they are
copied. If symlinks are created with
.B ln \-rs
or
.B ln \-rS
then they are required "to work" as described with the
.B \-S
flag.
.TP
.B \-v
Verbose. Show what is done on standard output.
.TP
.B \-x
Do not cross mount points. Empty directories will be created if the source
directory is a mount point on a copy, move or link. A mount point will not
be removed or traversed recursively. This flag allows one to copy the root
device, e.g.
.BR "cpdir \-x / /mnt" .
.SH "SEE ALSO"
.BR cat (1),
.BR mkdir (1),
.BR rmdir (1),
.BR mkdir (2),
.BR rmdir (2),
.BR link (2),
.BR unlink (2),
.BR rename (2),
.BR open (2),
.BR read (2),
.BR write (2),
.BR opendir (3).
.SH NOTES
All the utilities described are links to the same program.
.SH BUGS
.B Mv
should first copy a tree across devices and then remove the source tree if
there was no error. Instead, each file in the tree is copied and
immediately removed. On error you may be left with two half-filled trees,
together containing all of the files. You may have to restart the move with
.BR "mv \-m" .
.PP
.B Rm
should be able to remove arbitrarily deep trees.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

29
man/man1/crc.1 Normal file
View file

@ -0,0 +1,29 @@
.TH CRC 1
.SH NAME
crc \- print the checksum of the file data
.SH SYNOPSIS
\fBcrc \fIfile\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "crc *.c" "Print checksums of all the C programs"
.SH DESCRIPTION
.PP
The checksum of each argument is computed and printed, along with the file
length and its name, one file per line.
This program is useful for seeing if a file transmitted to another machine
has arrived correctly.
It is conceptually similar to \fIsum\fR, except that it uses a stronger
checksum algorithm and also prints the length.
.SH "SEE ALSO"
.BR cksum (1),
.BR sum (1).

93
man/man1/crontab.1 Normal file
View file

@ -0,0 +1,93 @@
.TH CRONTAB 1
.SH NAME
crontab \- User crontab manipulation
.SH SYNOPSIS
.B crontab \-c
.RI [ user ]
.I file
.br
.B crontab \-l
.RI [ user ]
.br
.B crontab \-r
.RI [ user ]
.br
.B crontab \-p
.SH DESCRIPTION
The
.B crontab
program allows users to manipulate their personal crontab files. These
files are hidden in
.BI /usr/spool/crontabs/ user
where
.I user
is the login name of a given user. The system daemon
.B cron
uses these crontabs, among others, to run tasks that are to be repeated at
regular intervals. See
.BR crontab (5)
on what a good crontab file should look like.
.PP
Only the superuser can specify a user name to manipulate the crontab of a
given user. Any other user can only touch their own crontab file.
.SH OPTIONS
.TP
\fB\-c\fR [\fIuser\fR] \fIfile\fR
Install
.I file
as the crontab file of
.IR user .
.TP
\fB\-l\fR [\fIuser\fR]
List the crontab file of
.I user
to standard output.
.TP
\fB\-r\fR [\fIuser\fR]
Remove the crontab file of
.IR user .
.TP
\fB\-p\fR
Tell cron to reload its tables. Useful for system administrators to signal
a change to any of the system crontab files. Changes made by the
.B crontab
program are signalled automatically. (Mnemonic: \-p = "ping".)
.SH FILES
.TP \w'/usr/spool/crontabs/user'u+5n
.BI /usr/spool/crontabs/ user
Per user personal crontab file.
.SH "SEE ALSO"
.BR crontab (5),
.BR cron (8).
.SH DIAGNOSTICS
.B Crontab
preparses a new crontab and only installs it if correct. All errors are
sent to standard error, messages about installing a new table and telling
.B cron
to reload are sent to standard output.
.SH BUGS
.B Crontab
misses a
.B \-e
option that other implementations of this command allow one to edit the
current crontab and install the result. Seems quite handy until you try to
install a new crontab from an automated script. That's why this command
has a
.B \-c
option that installs a prepared crontab file. Use
.PP
.RS
.nf
crontab \-l >/tmp/tab
${EDITOR\-vi} /tmp/tab
crontab \-c /tmp/tab
.fi
.RE
.PP
to get the same effect as
.BR "crontab \-e" .
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
.\"
.\" $PchId: crontab.1,v 1.3 2000/07/17 18:51:04 philip Exp $

84
man/man1/ctags.1 Normal file
View file

@ -0,0 +1,84 @@
.TH CTAGS 1
.SH NAME
ctags - Generates "tags" and (optionally) "refs" files
.SH SYNOPSIS
\fBctags\fP [\fB-stvra\fP] \fIfilesnames\fP...
.SH DESCRIPTION
\fIctags\fP generates the "tags" and "refs" files
from a group of C source files.
The "tags" file is used by Elvis' ":tag" command,
control-] command,
and -t option.
The "refs" file is sometimes used by the \fIref(1)\fP program.
.PP
Each C source file is scanned for #define statements and
global function definitions.
The name of the macro or function becomes the name of a tag.
For each tag, a line is added to the "tags" file which contains:
.RS
.nf
- the name of the tag
- a tab character
- the name of the file containing the tag
- a tab character
- a way to find the particular line within the file.
.RE
.fi
.PP
The filenames list will typically be the names of all C source
files in the current directory, like this:
.RS
.nf
$ ctags -stv *.[ch]
.RE
.fi
.SH OPTIONS
.IP \fB-t\fR
Include typedefs.
A tag will be generated for each user-defined type.
Also tags will be generated for struct and enum names.
Types are considered to be global if they are defined in a header file,
and static if they are defined in a C source file.
.IP \fB-v\fR
Include variable declarations.
A tag will be generated for each variable, except for those that are declared
inside the body of a function.
.IP \fB-s\fR
Include static tags.
\fICtags\fR will normally put global tags in the "tags" file, and silently ignore
the static tags.
This flag causes both global and static tags to be added.
The name of a static tag is generated by prefixing the name of the declared
item with the name of the file where it is defined, with a colon in between.
For example, "static foo(){}" in "bar.c" results in a tag named "bar.c:foo".
.IP \fB-r\fP
This causes \fIctags\fP to generate both "tags" and "refs".
Without \fB-r\fP, it would only generate "tags".
.IP \fB-a\fR
Append to "tags", and maybe "refs".
Normally, \fIctags\fR overwrites these files each time it is invoked.
This flag is useful when you have to many files in the current directory
for you to list them on a single command-line;
it allows you to split the arguments among several invocations.
.SH FILES
.IP tags
A cross-reference that lists each tag name, the name of the source file that
contains it, and a way to locate a particular line in the source file.
.IP refs
The "refs" file contains the definitions for each tag in the "tags" file,
and very little else.
This file can be useful, for example, when licensing restrictions prevent
you from making the source code to the standard C library readable by everybody,
but you still everybody to know what arguments the library functions need.
.SH BUGS
.PP
\fIctags\fR is sensitive to indenting and line breaks.
Consequently, it might not discover all of the tags in a file that
is formatted in an unusual way.
.SH "SEE ALSO"
elvis(1), refs(1)
.SH AUTHOR
.nf
Steve Kirkendall
kirkenda@cs.pdx.edu
.fi

46
man/man1/cut.1 Normal file
View file

@ -0,0 +1,46 @@
.TH CUT 1
.SH NAME
cut \- select out columns of a file
.SH SYNOPSIS
\fBcut [ \fB \-b \fR|\fB \-c\fR] \fIlist\fR [\fIfile...\fR]\fR
.br
\fBcut \-f \fIlist\fR [\fB\-d \fIdelim\fR] [\fB \-s\fR]\fR [\fIfile...\fR]"
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-b" "Cut specified bytes"
.FL "\-c" "Select out specific characters"
.FL "\-d" "Change the column delimiter to \fIdelim\fR"
.FL "\-f" "Select out specific fields that are separated by the delimiter character ( see \fIdelim\fR)"
.FL "\-i" "Runs of delimiters count as one"
.FL "\-s" "Suppres lines with no delimiter characters, when used with the \-f option. Lines with no delimiters are passwd through untouched"
.SH EXAMPLES
.EX "cut \-f 2 file" "Extract field 2"
.EX "cut \-c 1\-2,5 file" "Extract character columns 1, 2, and 5"
.EX "cut \-c 1\-5,7\- file" "Extract all columns except 6"
.SH DESCRIPTION
.PP
\fICut\fR extracts one or more fields or columns from a file and writes them on
standard output.
If the \fB\-f\fR flag is used, the fields are separated by a delimiter
character, normally a tab, but can be changed using the \fB\-d\fR flag.
If the \fB\-c\fR flag is used, specific columns can be specified.
The list can be comma or BLANK separated. The \fB\-f\fR and
\fB\-c\fR flags are mutually exclusive.
Note: The POSIX1003.2 standard requires the option \-b to cut out
specific bytes in a file. It is intended for systems with multi byte
characters (e.g. kanji), since MINIX uses only one byte characters,
this option is equivalent to \-c. For the same reason, the option
\-n has no effect and is not listed in this manual page.
.SH "SEE ALSO"
.BR sed (1),
.BR awk (9).

78
man/man1/date.1 Normal file
View file

@ -0,0 +1,78 @@
.TH DATE 1
.SH NAME
date \- print or set the date and time
.SH SYNOPSIS
\fBdate [\fB\-qsuS\fR] [\fB\-r\fI seconds\fR]
[[\fIMMDDYY\fR]\fIhhmm\fR[\fIss\fR]] [\fI+format\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-q" "Read the date from \fIstdin\fR"
.FL "\-s" "Set the time (implicit for \fB\-q\fR or a date string)"
.FL "\-u" "Print the date as GMT"
.FL "\-S" "Date within Eternal September"
.FL "\-r" "Use this number of seconds instead of current time"
.SH EXAMPLES
.EX "date" "Print the date and time"
.EX "date 0221921610" "Set date to Feb 21, 1992 at 4:10 p.m."
.SH DESCRIPTION
.PP
With the \fB\-q\fR flag or a numeric argument,
.I date
sets the GMT time and date.
.I MMDDYY
refers to the month, day, and year;
.I hhmmss
refers to the hour, minute and second.
Each of the six fields must be exactly two digits, no more and no less.
.I date
always display the date and time, with the default format for the system.
The \fB\-u\fR flag request GMT time instead of local time.
A format may be specified with a + followed by a printf-like string with
the following options:
.ta 0.25i
.nf
.PP
%% % character
%A Name of the day
%B Name of the month
%D mm/dd/yy
%H Decimal hour on 2 digits
%I Decimal hour modulo 12 on 2 digits
%M Decimal minute on 2 digits
%S Decimal seconds on 2 digits
%T HH:MM:SS
%U Decimal week number, Sunday being first day of week
%W Decimal week number, Monday being first day of week
%X Same as %T
%Y Decimal year on 4 digits
%Z Time Zone (if any)
%a Abbreviated name of the day
%b Abbreviated name of the month
%c Appropriate date & time (default format)
%d Decimal day of the month on 2 digits
%e Same as %d, but a space replaces leading 0
%h Same as %b
%j Decimal dey of the year on 3 digits
%m Decimal month on 2 digits
%n Newline character
%p AM or PM
%r 12-hour clock time with AM/PM
%s Number of seconds since the epoch
%t Tab character
%w Decimal day of the week (0=Sunday)
%x Same as %D
%y Decimal year on 2 digits
.SH "SEE ALSO"
.BR time (2),
.BR ctime (3),
.BR readclock (8).

62
man/man1/dd.1 Normal file
View file

@ -0,0 +1,62 @@
.TH DD 1
.SH NAME
dd \- convert and copy a file
.SH SYNOPSIS
\fBdd\fR [\fIoption = value\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "dd if=/dev/fd0 of=/dev/fd1" "Copy disk 0 to disk 1"
.EX "dd if=x of=y bs=1w skip=4" "Copy \fIx\fP to \fIy\fP, skipping 4 words"
.EX "dd if=x of=y count=3" "Copy three 512\-byte blocks"
.SH DESCRIPTION
.PP
This command is intended for copying partial files.
The block size, skip count, and number of blocks to copy can be specified.
The options are:
.PP
.ta 0.25i 1.5i
\fBif\fR = file \- Input file (default is \fIstdin\fR)
.br
\fBof\fR = file \- Output file (default is standard output)
.br
\fBibs\fR = n \- Input block size (default 512 bytes)
.br
\fBobs\fR = n \- Output block size (default is 512 bytes)
.br
\fBbs\fR = n \- Block size; sets \fIibs\fP and \fIobs\fP (default is 512 bytes)
.br
\fBskip\fR = n \- Skip \fIn\fP input blocks before reading
.br
\fBseek\fR = n \- Skip \fIn\fP output blocks before writing
.br
\fBcount\fR = n \- Copy only \fIn\fP input blocks
.br
\fBconv = lcase\fR \- Convert upper case letters to lower case
.br
\fBconv = ucase\fR \- Convert lower case letters to upper case
.br
\fBconv = swab\fR \- Swap every pair of bytes
.br
\fBconv = noerror\fR \- Ignore errors and just keep going
.br
\fBconv = silent\fR \- Suppress statistics (Minix specific flag)
.PP
Where sizes are expected, they are in bytes.
However, the letters \fBw\fR, \fBb\fR, or \fBk\fR may be appended to the
number to indicate words (2 bytes), blocks (512 bytes), or K
(1024 bytes), respectively.
When
.I dd
is finished, it reports the number of full and partial blocks read and written.
.SH "SEE ALSO"
.BR vol (1).

75
man/man1/df.1 Normal file
View file

@ -0,0 +1,75 @@
.TH DF 1
.SH NAME
df \- report on free disk space
.SH SYNOPSIS
\fBdf\fP [\fB\-ikP\fP] [\fB\-t\fP \fItype\fP] [\fIfile\fP ...]
.SH DESCRIPTION
.B Df
lists the amount of free space on the currently mounted devices (no arguments),
or the devices given as arguments. If the argument is not a device then the
device it resides on is listed.
.SH OPTIONS
Without options,
.B df
will give a listing like this:
.sp
.nf
.if t .ft C
Filesystem 1k-Blocks free used % FUsed% Mounted on
/dev/c0d0p1s0 1440 635 805 56% 26% /
/dev/c0d0p1s1 32768 32390 378 2% 1% /tmp
/dev/c0d0p1s2 784657 517809 266848 35% 29% /usr
.if t .ft R
.fi
.PP
The
.B \-i
option shifts the focus to the files:
.sp
.nf
.if t .ft C
Filesystem Files free used % BUsed% Mounted on
/dev/c0d0p1s0 1024 759 265 26% 56% /
/dev/c0d0p1s1 5472 5468 4 1% 2% /tmp
/dev/c0d0p1s2 65535 46734 18801 29% 35% /usr
.if t .ft R
.fi
.PP
Option
.B \-P
makes
.B df
use \s-2POSIX\s+2 defined output in 512 byte units:
.sp
.nf
.if t .ft C
Filesystem 512-blocks Used Available Capacity Mounted on
/dev/c0d0p1s0 2880 1628 1252 57% /
/dev/c0d0p1s1 65536 756 64780 2% /tmp
/dev/c0d0p1s2 1569314 533748 1035566 35% /usr
.if t .ft R
.fi
.PP
With
.B \-k
1024 byte units would be used.
.PP
The
.B \-t
option limits
.BR df 's
output to file systems of the given
.IR type .
.SH FILES
.TP 15n
.B /etc/mtab
List of mounted file systems.
.SH "SEE ALSO"
.BR du (1),
.BR fstab (5).
.SH BUGS
Default output should also be in 512 byte units says \s-2POSIX\s+2.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
.\"
.\" $PchId: df.1,v 1.5 1998/07/27 19:48:47 philip Exp $

29
man/man1/dhrystone.1 Normal file
View file

@ -0,0 +1,29 @@
.TH DHRYSTONE 1
.SH NAME
dhrystone \- integer benchmark
.SH SYNOPSIS
\fBdhrystone\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "dhrystone" "Run the dhrystone benchmark"
.SH DESCRIPTION
.PP
Many years ago, a floating-point benchmark called \fIwhetstone\fR was
popular for benchmarking FORTRAN programs.
Nowadays, an integer benchmark called \fIdhrystone\fR is widely used
for benchmarking UNIX systems.
This is it.
Be warned, however, that \fIdhrystone\fR is entirely CPU bound, and
goes blindingly fast on machines with high-speed caches.
Although this is a good measure for programs that spend most of their
time in some inner loop, it is a poor benchmark for I/O bound applications.

47
man/man1/diff.1 Normal file
View file

@ -0,0 +1,47 @@
.TH DIFF 1
.SH NAME
diff \- print differences between two files
.SH SYNOPSIS
\fBdiff \fR [\fB\-c \fR|\fB \-e \fR|\fB \-C \fIn\fR\] [\fB\-br\fR]\fIfile1 file2\fR\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-C \fIn" "Produce output that contains \fIn\fR lines of context"
.FL "\-b" "Ignore white space when comparing"
.FL "\-c" "Produce output that contains three lines of context"
.FL "\-e" "Produce an \fIed\fR-script to convert \fIfile1\fR into \fIfile2\fR"
.FL "\-r" "Apply \fIdiff\fR recursively to files and directories of the same name, when \fIfile1\fR and \fIfile2\fR are both directories"
.SH EXAMPLES
.EX "diff file1 file2" "Print differences between 2 files"
.EX "diff -C 0 file1 file2" "Same as above"
.EX "diff -C 3 file1 file2" "Output three lines of context with every difference encountered"
.EX "diff -c file1 file2" Same as above"
.EX "diff /etc /dev" "Compares recursively the directories \fI/etc\fR and \fI/dev\fR"
.EX "diff passwd /etc" "Compares \fI./passwd\fR to \fI/etc/passwd"
.SH DESCRIPTION
.PP
\fIDiff\fR compares two files and generates a list of lines telling how
the two files differ. Lines may not be longer than 128 characters.
If the two arguments on the command line are both directories,
\fIdiff\fR recursively steps through all subdirectories comparing
files of the same name. If a file name is found only in one directory,
a diagnostic message is written to \fIstdout\fR. A file that is of
either block special, character special or FIFO special type, cannot
be compared to any other file.
On the other hand, if there is one directory and one file given on the
command line, \fIdiff\fR tries to compare the file with the same name
as \fIfile\fR in the directory \fIdirectory\fR.
.SH "SEE ALSO"
.BR cdiff (1),
.BR cmp (1),
.BR comm (1),
.BR patch (1).

44
man/man1/dosdir.1 Normal file
View file

@ -0,0 +1,44 @@
.TH DOSDIR 1
.SH NAME
dosdir \- list an MS-DOS directory [IBM]
.SH SYNOPSIS
\fBdosdir\fR [\fB\-lr\fR] \fIdrive\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-l" "Long listing"
.FL "\-r" "Recursively descend and print subdirectories"
.SH EXAMPLES
.EX "dosdir \-l A" "List root directory on drive A"
.EX "dosdir \-r C x/y" "Recursively list directory \fIx/y\fR"
.EX "dosdir \-r fd1" "List device \fI/dev/fd1\fR"
.SH DESCRIPTION
.PP
.I Dosdir
reads standard IBM PC diskettes or hard disk partitions in
\s-2MS-DOS\s+2 format and lists their contents on standard output.
Directory names should contain slashes to separate components, even though
\s-2MS-DOS\s+2 uses backslashes.
The names
.I dosdir ,
.I dosread ,
and
.I doswrite
are all links to the same program.
The program sees which function to perform by seeing how it was called.
A drive code of
.I A
causes the program to use \fI/dev/dosA\fR, for example,
a link to \fI/dev/fd0\fR.
Similarly, to have hard disk partition 1 be DOS drive C, \fI/dev/dosC\fR
could be a link to \fI/dev/hd1\fR, and so on for other drive codes.
A normal device name may also be used instead of a drive code.

30
man/man1/dosread.1 Normal file
View file

@ -0,0 +1,30 @@
.TH DOSREAD 1
.SH NAME
dosread \- read a file from an MS-DOS diskette [IBM]
.SH SYNOPSIS
\fBdosread\fR [\fB\-a\fR] \fIdrive \fIfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-a" "ASCII file"
.SH EXAMPLES
.EX "dosread C g/adv >adv" "Read file \fIg/adv\fR from hard disk"
.EX "dosread \-a A prog.c >x" "Read ASCII file \fIprog.c\fR from drive A"
.SH DESCRIPTION
.PP
.I Dosread
reads one \s-2MS-DOS\s+2 file and writes it on standard output.
The file name must use slash, not backslash as a separator.
ASCII files have the final CTRL-Z stripped, and carriage return plus
line feed are mapped to line feed only, the usual
\s-2MINIX\s+2
convention. See \fBdosdir\fR on the use of single letter drive codes.

28
man/man1/doswrite.1 Normal file
View file

@ -0,0 +1,28 @@
.TH DOSWRITE 1
.SH NAME
doswrite \- write a file onto an MS-DOS diskette [IBM]
.SH SYNOPSIS
\fBdoswrite\fR [\fB\-a\fR] \fIdrive \fIfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-a" "ASCII file"
.SH EXAMPLES
.EX "doswrite A x/y <z" "Write file \fIz\fR to disk as \fIx/y\fR"
.EX "doswrite \-a B f" "Copy \fIstdin\fR to \s-2MS-DOS\s+2 file \fIf\fR"
.SH DESCRIPTION
.PP
.I Doswrite
writes its \fIstdin\fR to an \s-2MS-DOS\s+2 file.
The diskette or partition must be formatted and have an \s-2MS-DOS\s+2 file
system already in place, including all the directories leading up to the file.
See \fBdosdir\fR on the use of single letter drive codes.

31
man/man1/du.1 Normal file
View file

@ -0,0 +1,31 @@
.TH DU 1
.SH NAME
du \- print disk usage
.SH SYNOPSIS
\fBdu\fR [\fB\-as\fR]\fR [\fB\-l \fIn\fR] \fIdir\fR ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-a" "Give usage for all files"
.FL "\-l" "List up to \fIn\fR levels of subdirectories"
.FL "\-d" "Do not cross file system boundaries"
.FL "\-s" "Summary only"
.SH EXAMPLES
.EX "du dir" "List disk space used by files in dir"
.EX "du \-s dir1 dir2" "Give summaries only"
.EX "du \-d /" "Show only the root device"
.SH DESCRIPTION
.PP
\fIDu\fR examines one or more directories and prints the amount of space
occupied by the files in those directories and their subdirectories.
.SH "SEE ALSO"
.BR df (1).

68
man/man1/echo.1 Normal file
View file

@ -0,0 +1,68 @@
.TH ECHO 1
.SH NAME \" Copyright (C) 1989 by Kenneth Almquist.
echo \- produce message in a shell script
.SH SYNOPSIS
.B echo
[
.B -n
|
.B -e
]
.I args...
.SH DESCRIPTION
.I Echo
prints its arguments on the standard output, separated by spaces.
Unless the
.B -n
option is present, a newline is output following the arguments.
The
.B -e
option causes
.I echo
to treat the escape sequences specially, as described in the following
paragraph.
Only one of the options
.B -n
and
.B -e
may be given.
.PP
If any of the following sequences of characters is encountered during
output, the sequence is not output. Instead, the specified action is
performed:
.de i
.IP "\\fB\\$1\\fR" 5
..
.i \eb
A backspace character is output.
.i \ec
Subsequent output is suppressed. This is normally used at the end of the
last argument to suppress the trailing newline that
.I echo
would otherwise output.
.i \ef
Output a form feed.
.i \en
Output a newline character.
.i \er
Output a carriage return.
.i \et
Output a (horizontal) tab character.
.i \ev
Output a vertical tab.
.i \e0\fIdigits\fR
Output the character whose value is given by zero to three digits.
If there are zero digits, a nul character is output.
.i \e\e
Output a backslash.
.SH HINTS
Remember that backslash is special to the shell and needs to be escaped.
To output a message to standard error, say
.sp
.ti +1i
echo message >&2
.SH BUGS
The octal character escape mechanism (\e0\fIdigits\fR) differs from the
C language mechanism.
.SH AUTHOR
Kenneth Almquist.

69
man/man1/ed.1 Normal file
View file

@ -0,0 +1,69 @@
.TH ED 1
.SH NAME
ed \- editor
.SH SYNOPSIS
\fBed \fIfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-" "Suppress line/byte count messages (for in scripts)"
.SH EXAMPLES
.EX "ed prog.c" "Edit \fIprog.c\fR"
.EX "echo '1,$p' | ed - file" "Odd way to write 'cat file'"
.SH DESCRIPTION
.PP
\fIEd\fR is functionally equivalent to the standard V7 editor, ed.
It supports the following commands:
.PP
.nf
.ta 0.5i 0.95i
(.) a: append
(.,.) c: change
(.,.) d: delete
e: edit new file"
f: print name of edited file"
(1,$) g: global command
(.) i: insert
(.,.+1) j: join lines together
(.) k: mark
(.) l: print with special characters in octal
(.,.) m: move
(.,.) p: print
q: quit editor"
(.) r: read in new file
(.,.) s: substitute
(1,$) v: like g, except select lines that do not match
(1,$) w: write out edited file
.fi
Many of the commands can take one or two addresses, as indicated above. The
defaults are shown in parentheses. Thus \fIa\fR appends to the current
line, and \fIg\fR works on the whole file as default.
The dot refers to the current line.
Below is a sample editing session with comments given following the # symbol.
.PP
.nf
.ta 0.5i 2.5i
ed prog.c # Edit prog.c
3,20p # Print lines 3 through 20
/whole/ # Find next occurence of \fIwhole\fR
s/whole/while/ # Replace \fIwhole\fR by \fIwhile\fR
g/Buf/s//BUF/g # Replace \fIBuf\fR by \fIBUF\fR everywhere
w # Write the file back
q # Exit the editor
.fi
\fIEd\fR is provided for its sentimental value.
If you want a line-oriented editor, try \fIex\fR.
If you want a good editor, use \fIelle\fR, \fIelvis\fR, or \fImined\fR.
.SH "SEE ALSO"
.BR elvis (1),
.BR elle (9),
.BR mined (9).

24
man/man1/eject.1 Normal file
View file

@ -0,0 +1,24 @@
.TH EJECT 1
.SH NAME
eject \- eject removable media
.SH SYNOPSIS
.B eject
.I device
.SH DESCRIPTION
.B Eject
tells a device to eject removable media, usually a floppy or CD-ROM.
.B Eject
invokes the
.B DIOCEJECT
ioctl on the device. The media will then be ejected, or allowed to be
removed. The call will fail if the device is still in use.
.PP
Tapes can't be unloaded with this command, use
.B mt offline
instead.
.SH "SEE ALSO"
.BR mt (1),
.BR hd (4),
.BR sd (4).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

100
man/man1/elvis.1 Normal file
View file

@ -0,0 +1,100 @@
.TH ELVIS 1
.SH NAME
elvis, ex, vi \- The editor
.SH SYNOPSIS
\fBelvis\fP [\fIflags\fP] [\fB+\fP\fIcmd\fP] [\fIfiles\fP...]
.SH DESCRIPTION
\fBElvis\fP is a text editor which emulates \fBvi\fP/\fBex\fP.
.PP
On systems which pass the program name as an argument, such as Unix and Minix,
you may also install \fBelvis\fP under the names "ex", "vi", "view", and "input".
These extra names would normally be links to elvis;
see the "ln" shell command.
.PP
When \fBelvis\fP is invoked as "vi",
it behaves exactly as though it was invoked as "elvis".
However, if you invoke \fBelvis\fP as "view",
then the readonly option is set as though you had given it the "-R" flag.
If you invoke \fBelvis\fP as "ex",
then \fBelvis\fP will start up in the colon command mode
instead of the visual command mode,
as though you had given it the "-e" flag.
If you invoke \fBelvis\fP as "input" or "edit",
then \fBelvis\fP will start up in input mode,
as though the "-i" flag was given.
.SH OPTIONS
.IP \fB-r\fP
To the real vi, this flag means that a previous edit should be recovered.
\fBElvis\fP, though, has a separate program, called \fIelvrec\fP(1), for recovering
files.
When you invoke \fBelvis\fP with -r, \fBelvis\fP will tell you to run \fBelvrec\fP.
.IP \fB-R\fP
This sets the "readonly" option,
so you won't accidentally overwrite a file.
.IP "\fB-t\fP \fItag\fP"
This causes \fBelvis\fP to start editing at the given tag.
.IP "\fB-m\fP [\fIfile\fP]"
\fBElvis\fP will search through \fIfile\fP for something that looks like
an error message from a compiler.
It will then begin editing the source file that caused the error,
with the cursor sitting on the line where the error was detected.
If you don't explicitly name a \fIfile\fP, then "errlist" is assumed.
.IP \fB-e\fP
\fBElvis\fP will start up in colon command mode.
.IP \fB-v\fP
\fBElvis\fP will start up in visual command mode.
.IP \fB-i\fP
\fBElvis\fP will start up in input mode.
.IP "\fB-w\fR \fIwinsize\fR"
Sets the "window" option's value to \fIwinsize\fR.
.IP "\fB+\fP\fIcommand\fP or \fB-c\fP \fIcommand\fP"
If you use the +\fIcommand\fP parameter,
then after the first file is loaded
\fIcommand\fP is executed as an EX command.
A typical example would be "elvis +237 foo",
which would cause \fBelvis\fP to start editing foo and
then move directly to line 237.
The "-c \fIcommand\fP" variant was added for UNIX SysV compatibility.
.SH FILES
.IP /tmp/elv*
During editing,
\fBelvis\fP stores text in a temporary file.
For UNIX, this file will usually be stored in the /tmp directory,
and the first three characters will be "elv".
For other systems, the temporary files may be stored someplace else;
see the version-specific section of the documentation.
.IP tags
This is the database used by the \fB:tags\fP command and the \fB-t\fP option.
It is usually created by the \fBctags\fP(1) program.
.IP ".exrc or elvis.rc"
On UNIX-like systems, a file called ".exrc" in your home directory
is executed as a series of \fBex\fR commands.
A file by the same name may be executed in the current directory, too.
On non-UNIX systems, ".exrc" is usually an invalid file name;
there, the initialization file is called "elvis.rc" instead.
.SH "SEE ALSO"
.BR ctags (1),
.BR ref (1),
.BR virec (1),
.BR elvis (9).
.PP
\fIElvis - A Clone of Vi/Ex\fP, the complete \fBelvis\fP documentation.
.SH BUGS
There is no LISP support.
Certain other features are missing, too.
.PP
Auto-indent mode is not quite compatible with the real vi.
Among other things, 0^D and ^^D don't do what you might expect.
.PP
Long lines are displayed differently.
The real vi wraps long lines onto multiple rows of the screen,
but \fBelvis\fP scrolls sideways.
.SH AUTHOR
.nf
Steve Kirkendall
kirkenda@cs.pdx.edu
.fi
.PP
Many other people have worked to port \fBelvis\fP to various operating systems.
To see who deserves credit, run the \fB:version\fP command from within \fBelvis\fP,
or look in the system-specific section of the complete documentation.

47
man/man1/elvrec.1 Normal file
View file

@ -0,0 +1,47 @@
.TH ELVREC 1
.SH NAME
elvrec - Recover the modified version of a file after a crash
.SH SYNOPSIS
.nf
\fBelvrec\fP [\fIpreservedfile\fP [\fInewfile\fR]]
.fi
.SH DESCRIPTION
.PP
If you're editing a file when \fIelvis\fP dies, the system crashes, or power fails,
the most recent version of your text will be preserved.
The preserved text is stored in a special directory; it does NOT overwrite
your text file automatically.
.PP
The \fIelvrec\fP program locates the preserved version of a given file,
and writes it over the top of your text file -- or to a new file, if you prefer.
The recovered file will have nearly all of your changes.
.PP
To see a list of all recoverable files, run \fIelvrec\fP with no arguments.
.SH FILES
.IP /usr/preserve/p*
The text that was preserved when \fIelvis\fP died.
.IP /usr/preserve/Index
A text file which lists the names of all preserved files, and the names
of the /usr/preserve/p* files which contain their preserved text.
.SH BUGS
.PP
\fIelvrec\fP is very picky about filenames.
You must tell it to recover the file using exactly the same pathname as
when you were editing it.
The simplest way to do this is to go into the same directory that you were
editing, and invoke \fIelvrec\fP with the same filename as \fIelvis\fP.
If that doesn't work, then try running \fIelvrec\fP with no arguments,
to see exactly which pathname it is using for the desired file.
.PP
Due to the permissions on the /usr/preserve directory, on UNIX systems
\fIelvrec\fP must be run as superuser.
This is accomplished by making the \fIelvrec\fP executable be owned by "root"
and setting its "set user id" bit.
.PP
If you're editing a nameless buffer when \fIelvis\fP dies, then \fIelvrec\fP
will pretend that the file was named "foo".
.SH AUTHOR
.nf
Steve Kirkendall
kirkenda@cs.pdx.edu
.fi

93
man/man1/env.1 Normal file
View file

@ -0,0 +1,93 @@
.TH ENV 1
.SH NAME
env \- set environment for command
.SH SYNOPSIS
.B env
.RB [ \-ia ]
.RI [ name\fB=\fIvalue "] ..."
.RI [ utility
.RI [ argument "...]]"
.SH DESCRIPTION
.B Env
modifies its environment according to the
.IB name = value
arguments, and executes
.I utility
with the given arguments and the modified environment.
.PP
If no utility is specified then the modified environment is printed as
.IB name = value
strings, one per line.
.SH OPTIONS
.TP
.B \-i
Use exactly the environment specified by the arguments; the inherited
environment is ignored.
.TP
.B \-a
Specify all arguments for the utility, i.e. the first of the arguments is
used as
.BR "argv[0]" ,
the program name. Normally the program name is
.I utility
itself.
.SH ENVIRONMENT
.TP 8n
.B PATH
The path used to find utility. It is as modified by
.BR env ,
i.e.
.B not
the inherited
.BR PATH .
.SH "SEE ALSO"
.BR sh (1),
.BR execvp (3),
.BR environ (5).
.SH DIAGNOSTICS
The return code is
.B 0
after successfully printing the environment,
.B 1
on an error within
.BR env ,
.B 126
if the
.I utility
could not be executed, or
.B 127
if
.I utility
could not be found. Appropriate diagnostic messages are printed on standard
error.
If
.I utility
can be executed then it replaces
.BR env ,
so the return code is then the return code of
.IR utility .
.SH NOTES
When run from the standard shell
.B env
is only useful with options or without arguments. Otherwise the shell can
do exactly what
.B env
can do, simply omit the word "env" on the command line.
.PP
One interesting use of
.B env
is with #! on the first line of a script to forge a PATH search for an
interpreter. For example:
.PP
.RS
#!/usr/bin/env perl
.RE
.PP
This will find the Perl interpreter if it is within the user's PATH. Most
UNIX-like systems have
.B env
in /usr/bin, but
.B perl
may be anywhere.
.SH AUTHOR
Kees J. Bot <kjb@cs.vu.nl>

28
man/man1/expand.1 Normal file
View file

@ -0,0 +1,28 @@
.TH EXPAND 1
.SH NAME
expand \- convert tabs to spaces
.SH SYNOPSIS
\fBexpand\fR [\fB\-\fIt1,t2, ...\fR]\fR [\fIfile\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-\fIt\fR" "Tab stop positions"
.SH EXAMPLES
.EX "expand \-16,32,48,64" "Expand \fIstdin\fR with tabs every 16 columns"
.SH DESCRIPTION
.PP
\fIExpand\fR replaces tabs in the named files with the equivalent numbers
of spaces. If no files are listed, \fIstdin\fR is given. If only one
tab is given, the rest are multiples of it. The default is a tab every 8
spaces.
.SH "SEE ALSO"
.BR unexpand (1).

243
man/man1/expr.1 Normal file
View file

@ -0,0 +1,243 @@
.TH EXPR 1
.SH NAME \" Copyright (C) 1989 by Kenneth Almquist.
expr, test, [ \- evaluate expressions
.SH SYNOPSIS
.B expr
.I expression
.br
.B test
.I expression
.br
.B [
.I expression
.B ]
.SH DESCRIPTION
.B Expr
evaluates the expression and prints the result.
.B Test
evaluates the expression without printing the result.
The ``[''
command is a synonym for
.BR test ;
when invoked under this name
the last argument to
.B expr
must be a ``]'', which is deleted and not considered part of the expression.
.PP
Three data types may occur in the
.IR expression :
string, integer, and boolean.
The rules for conversion are as follows:
.sp
.nr i 2
.ta \nii
.in +\nii
.ti -\nii
\fIstring\fR\->\fIinteger\fR Done via
.BR atoi (3).
.ti -\nii
\fIinteger\fR\->\fIstring\fR Convert to decimal representation.
.ti -\nii
\fIstring\fR\->\fIboolean\fR "" \-> false, everything else to true.
.ti -\nii
\fIboolean\fR\->\fIstring\fR false \-> "", true \-> "true".
.ti -\nii
\fIinteger\fR\->\fIboolean\fR 0 \-> false, everything else to true.
.ti -\nii
\fIboolean\fR\->\fIinteger\fR false \-> 0, true \-> 1.
.in -\nii
.PP
Any argument to
.B expr
which is not a legal operator is treated as a string operand of type
.BR string .
.PP
As a special case, if
.I expression
is omitted, the result is false.
.PP
We now list the operators. The syntax
.sp
.ti +8
\fIinteger\fB op \fIinteger\fR \-> \fIboolean\fB (3)\fR
.sp
means that \fBop\fR is a binary operator which takes operands of type
\fIinteger\fR and produces a result of type \fIboolean\fR.
The ``(3)'' means that the priority of \fBop\fR is 3.
Operands are automatically converted to the appropriate type. The type
\fIany\fR is used for operator that take operands of any type.
.nr p 1
.de b
.TP 0.5i
\fI\\$1\fB \\$2 \fI\\$3\fR \-> \\fI\\$4\\fR (\\np)
..
.de u
.TP 0.5i
\\$1 \fI\\$2\fR \-> \\fI\\$3\\fR (\\np)
..
.b any \-o any any
Returns the value of the left hand operand if the left hand operand
would yield
.B true
if converted to type
.BR boolean ,
and the value of the right hand operand otherwise.
The right hand operand is evaluated only if necessary.
``|'' is a synonym for ``\-o''.
.nr p \np+1
.b any -a any any
Returns the value of the left hand operand if the left hand operand
would yield
.B false
if converted to type
.BR boolean ,
and the value of the right hand operand otherwise.
The right hand operand is evaluated only if necessary.
``&'' is a synonym for ``\-a''.
.nr p \np+1
.u ! boolean boolean
Returns true if the operand is false, and false if the operand is true.
.nr p \np+1
.b string = string boolean
True if the two strings are equal.
.b string != string boolean
True if the two strings are not equal.
.b integer \-eq integer boolean
True if the two operands are equal.
.b integer \-ne integer boolean
True if the two operands are not equal.
.b integer \-gt integer boolean
True if the first operand is greater than the second one.
.b integer \-lt integer boolean
True if the first operand is less than the second one.
.b integer \-ge integer boolean
True if the first operand is greater than or equal to the second one.
.b integer \-le integer boolean
True if the first operand is less than or equal to the second one.
.nr p \np+1
.b integer + integer integer
Add two integers.
.b integer \- integer integer
Subtract two integers.
.nr p \np+1
.b integer * integer integer
Multiply two integers. ``*'' is special to the shell, so you generally
have to write this operator as ``\e*''.
.b integer / integer integer
Divide two integers.
.b integer % integer integer
Returns the remainder when the first operand is divided by the second one.
.nr p \np+1
.b string : string "integer or string"
The second operand is interpreted as a regular expression (as in the
System V
.B ed
program).
This operator attempts to match part (or all) of the first operand
with the regular expression. The match must start at the beginning of
the first operand.
If the regular expression contains \e( \e) pairs, then the result
of this operator is the string which is matched by the regular expression
between these pairs, or the null string if no match occurred. Otherwise,
the result is the number of characters matched by the regular expression,
or zero if no no match occurred.
.nr p \np+1
.u \-n string integer
Returns the number of characters in the string.
.u \-z string boolean
Returns true if the string contains zero characters.
.u \-t integer boolean
Returns true if the specified file descriptor is associated with a tty.
.PP
The remaining operators all deal with files. Except as noted, they return
false if the
specified file does not exist. The ones dealing with permission use
the effective user and group ids of the shell.
.u \-r string boolean
True if you have read permission on the file.
.u \-w string boolean
True if you have write permission on the file.
.u \-x string boolean
True if you have execute permission on the file.
.u \-f string boolean
True if the file is a regular file.
.u \-d string boolean
True if the file is a directory.
.u \-c string boolean
True if the file is a character special file.
.u \-b string boolean
True if the file is a block special file.
.u \-p string boolean
True if the file is a named pipe (i.e. a fifo).
.u \-u string boolean
True if the file is setuid.
.u \-g string boolean
True if the file is setgid.
.u \-k string boolean
True if the file has the sticky bit set.
.u \-s string "integer or boolean"
Returns the size of the file, or 0 if the file does not exist.
.u \-h string boolean
True if the file is a symlink. This is the only file test operator that
does not follow symlinks, all others do. So ``\-d'' and ``\-h''
are both true on a symlink pointing to a directory.
``\-L'' is a synonym for ``\-h''.
.SH "EXIT CODE"
0 if the result of
.I expression
would be
.B true
if the result were converted to
.BR boolean .
.br
1 if the result of
.I expression
would be
.B false
if the result were converted to
.BR boolean .
.br
2 if
.I expression
is syntactically incorrect.
.SH EXAMPLES
.TP 0.5i
filesize=`expr \-s file`
Sets the shell variable
.I filesize
to the size of
.IR file .
.TP 0.5i
if [ \-s file ]; then command; fi
Execute
.I command
if
.I file
exists and is not empty.
.TP 0.5i
x=`expr "$x" : '.\\{4\\}\\(.\\{0,3\\}\\)'`
Sets
.I x
to the substring of
.I x
beginning after the fourth character of
.I x
and continuing for three characters or until the end of the string,
whichever comes first.
.TP 0.5i
x=`expr X"$x" : X'.\\{4\\}\\(.\\{0,3\\}\\)'`
This example is the same as the previous one, but it uses a leading
``X'' to make things work when the value of
.I x
looks like an operator.
.SH BUGS
The relational operators of the System V
.B expr
command are not implemented.
.PP
Certain features of this version of
.B expr
are not present in System V, so care should be used when writing
portable code.
.SH COPYRIGHT
Kenneth Almquist.

22
man/man1/factor.1 Normal file
View file

@ -0,0 +1,22 @@
.TH FACTOR 1
.SH NAME
factor \- factor an integer less than 2**31
.SH SYNOPSIS
\fBfactor \fInumber\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "factor 450180" "Print the prime factors of 450180"
.SH DESCRIPTION
.PP
\fIFactor\fR prints the prime factors of its argument in increasing order.
Each factor is printed as many times as it appears in the number.

35
man/man1/fgrep.1 Normal file
View file

@ -0,0 +1,35 @@
.TH FGREP 1
.SH NAME
fgrep \- fixed grep
.SH SYNOPSIS
\fBfgrep\fR [\fB\-cfhlnsv\fR]\fR [\fIstring_file\fR] [\fIstring\fR] [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-c" "Count matching lines and only print count, not the lines"
.FL "\-f" "Take strings from file named in following argument"
.FL "\-h" "Omit file headers from printout"
.FL "\-l" "List file names once only"
.FL "\-n" "Each line is preceded by its line number"
.FL "\-s" "Status only, no output"
.FL "\-v" "Print only lines not matching"
.SH EXAMPLES
.EX "fgrep % prog.c" "Print lines containing % sign"
.EX "fgrep \-f pattern prog.c" "Take strings from \fIpattern\fR"
.SH DESCRIPTION
.PP
\fIFgrep\fR is essentially the same as grep, except that it only searches
for lines containing literal strings (no wildcard characters). The pattern
may consist of several lines with one string to search on each line.
.SH "SEE ALSO"
.BR cgrep (1),
.BR grep (1).

24
man/man1/file.1 Normal file
View file

@ -0,0 +1,24 @@
.TH FILE 1
.SH NAME
file \- make a guess as to a file's type based on contents
.SH SYNOPSIS
\fBfile \fIname ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "file a.out ar.h" "Guess at types"
.SH DESCRIPTION
.PP
\fIFile\fR reads the first block of a file and tries to make an
intelligent guess about what kind of file it is.
It understands about archives, C
source programs, executable binaries, shell scripts, and English text.

84
man/man1/find.1 Normal file
View file

@ -0,0 +1,84 @@
.TH FIND 1
.SH NAME
find \- find files meeting a given condition
.SH SYNOPSIS
\fBfind \fIdirectory \fIexpression\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "find / \-name a.out \-print" "Print all \fIa.out\fR paths"
.EX "find /usr/ast ! \-newer f \-ok rm {} \e;" "Ask before removing"
.EX "find /usr \-size +20 \-exec mv {} /big \e^;" "move files > 10k"
.EX "find / \e( \-name a.out \-o \-name \(fm*.o\(fm \e) \-exec rm {} \e;" "2 conds"
.SH DESCRIPTION
.PP
\fIFind\fR descends the file tree starting at the given directory checking
each file in that directory and its subdirectories against a predicate.
If the predicate is true, an action is taken. The predicates may be
connected by \fB\-a\fR (Boolean and), \fB\-o\fR (Boolean or) and !
(Boolean negation).
Each predicate is true under the conditions specified below. The integer
\fIn\fR may also be +\fIn\fR to mean any value greater than \fIn\fR,
\fI\-n\fR to mean any value less than
\fIn\fR, or just \fIn\fR for exactly \fIn\fR.
.PP
.RS
.ta +\w'\-mtime nmm'u
.in +\w'\-mtime nmm'u
.ti -\w'\-mtime nmm'u
\-name s true if current filename is \fIs\fR (include shell wild cards)
.ti -\w'\-mtime nmm'u
\-size n true if file size is \fIn\fR blocks
.ti -\w'\-mtime nmm'u
\-inum n true if the current file's i-node number is \fIn\fR
.ti -\w'\-mtime nmm'u
\-mtime n true if modification time relative to today (in days) is \fIn\fR
.ti -\w'\-mtime nmm'u
\-links n true if the number of links to the file is \fIn\fR
.ti -\w'\-mtime nmm'u
\-newer f true if the file is newer than \fIf\fR
.ti -\w'\-mtime nmm'u
\-perm n true if the file's permission bits = \fIn\fR (\fIn\fR is in octal)
.ti -\w'\-mtime nmm'u
\-user u true if the uid = \fIu\fR (a numerical value, not a login name)
.ti -\w'\-mtime nmm'u
\-group g true if the gid = \fIg\fR (a numerical value, not a group name)
.ti -\w'\-mtime nmm'u
\-type x where \fIx\fR is \fBbcdfug\fR (block, char, dir, regular file, setuid, setgid)
.ti -\w'\-mtime nmm'u
\-xdev do not cross devices to search mounted file systems
.in -\w'\-mtime nmm'u
.fi
.RE
.PP
Following the expression can be one of the following, telling what to do
when a file is found:
.PP
.RS
.ta +\w'\-mtime nmm'u
.in +\w'\-mtime nmm'u
.ti -\w'\-mtime nmm'u
\-print print the file name on standard output
.ti -\w'\-mtime nmm'u
\-print0 print the file name terminated by a null character, to be
used with
.BR "xargs \-0" .
(Minix extension).
.ti -\w'\-mtime nmm'u
\-exec execute a command, {} stands for the file name
.ti -\w'\-mtime nmm'u
\-ok prompts before executing the command
.in -\w'\-mtime nmm'u
.RE
.SH "SEE ALSO"
.BR test (1),
.BR xargs (1).

84
man/man1/finger.1 Normal file
View file

@ -0,0 +1,84 @@
.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)finger.1 6.4 (Berkeley) 5/10/86
.\"
.TH FINGER 1 "May 10, 1986"
.UC 4
.SH NAME
finger \- user information lookup program
.SH SYNOPSIS
.B finger
[
options
] name ...
.SH DESCRIPTION
By default
.B finger
lists the login name, full name, terminal name and write status
(as a `*' before the terminal name if write permission is denied),
idle time, login time, and office location and phone number
(if they are known) for each current UNIX user.
(Idle time is minutes if it is a single integer, hours and minutes if a ':'
is present, or days and hours if a 'd' is present.)
.PP
A longer format also exists and is used by
.B finger
whenever a list of people's names is given. (Account names as well as
first and last names of users are accepted.)
This format is multi-line, and includes all the information described above
as well as the user's home
directory and login shell, any plan which the person has placed in the file
.B \&.plan
in their home
directory, and the project on which they are working from the file
.B \&.project
also in the home directory.
.PP
.B Finger
may be used to lookup users on a remote machine. The format is to specify
the user as ``user@host.'' If the user name is left off, the
standard format listing is provided on the remote machine.
.PP
.B Finger
options include:
.TP
.B \-m
Match arguments only on user name.
.TP
.B \-l
Force long output format.
.TP
.B \-p
Suppress printing of the
.B \&.plan
files
.TP
.B \-s
Force short output format.
.SH FILES
.ta 2i
/etc/utmp who file
.br
/etc/passwd for users names, offices, ...
.br
/usr/adm/lastlog last login times
.br
~/.plan plans
.br
~/.project projects
.SH "SEE ALSO"
.BR chfn (1),
.BR w (1),
.BR who (1).
.SH AUTHOR
Earl T. Cohen
.SH BUGS
Only the first line of the
.B .project
file is printed.
.PP
There is no way to pass arguments to the remote machine as
.B finger
uses an internet standard port.

779
man/man1/flex.1 Normal file
View file

@ -0,0 +1,779 @@
.TH FLEX 1 "26 May 1990" "Version 2.3"
.SH NAME
flex, lex - fast lexical analyzer generator
.SH SYNOPSIS
.B flex
.B [-bcdfinpstvFILT8 -C[efmF] -Sskeleton]
.I [filename ...]
.SH DESCRIPTION
.I flex
is a tool for generating
.I scanners:
programs which recognized lexical patterns in text.
.I flex
reads
the given input files, or its standard input if no file names are given,
for a description of a scanner to generate. The description is in
the form of pairs
of regular expressions and C code, called
.I rules. flex
generates as output a C source file,
.B lex.yy.c,
which defines a routine
.B yylex().
This file is compiled and linked with the
.B -lfl
library to produce an executable. When the executable is run,
it analyzes its input for occurrences
of the regular expressions. Whenever it finds one, it executes
the corresponding C code.
.LP
For full documentation, see
.B flexdoc(1).
This manual entry is intended for use as a quick reference.
.SH OPTIONS
.I flex
has the following options:
.TP
.B -b
Generate backtracking information to
.I lex.backtrack.
This is a list of scanner states which require backtracking
and the input characters on which they do so. By adding rules one
can remove backtracking states. If all backtracking states
are eliminated and
.B -f
or
.B -F
is used, the generated scanner will run faster.
.TP
.B -c
is a do-nothing, deprecated option included for POSIX compliance.
.IP
.B NOTE:
in previous releases of
.I flex
.B -c
specified table-compression options. This functionality is
now given by the
.B -C
flag. To ease the the impact of this change, when
.I flex
encounters
.B -c,
it currently issues a warning message and assumes that
.B -C
was desired instead. In the future this "promotion" of
.B -c
to
.B -C
will go away in the name of full POSIX compliance (unless
the POSIX meaning is removed first).
.TP
.B -d
makes the generated scanner run in
.I debug
mode. Whenever a pattern is recognized and the global
.B yy_flex_debug
is non-zero (which is the default), the scanner will
write to
.I stderr
a line of the form:
.nf
--accepting rule at line 53 ("the matched text")
.fi
The line number refers to the location of the rule in the file
defining the scanner (i.e., the file that was fed to flex). Messages
are also generated when the scanner backtracks, accepts the
default rule, reaches the end of its input buffer (or encounters
a NUL; the two look the same as far as the scanner's concerned),
or reaches an end-of-file.
.TP
.B -f
specifies (take your pick)
.I full table
or
.I fast scanner.
No table compression is done. The result is large but fast.
This option is equivalent to
.B -Cf
(see below).
.TP
.B -i
instructs
.I flex
to generate a
.I case-insensitive
scanner. The case of letters given in the
.I flex
input patterns will
be ignored, and tokens in the input will be matched regardless of case. The
matched text given in
.I yytext
will have the preserved case (i.e., it will not be folded).
.TP
.B -n
is another do-nothing, deprecated option included only for
POSIX compliance.
.TP
.B -p
generates a performance report to stderr. The report
consists of comments regarding features of the
.I flex
input file which will cause a loss of performance in the resulting scanner.
.TP
.B -s
causes the
.I default rule
(that unmatched scanner input is echoed to
.I stdout)
to be suppressed. If the scanner encounters input that does not
match any of its rules, it aborts with an error.
.TP
.B -t
instructs
.I flex
to write the scanner it generates to standard output instead
of
.B lex.yy.c.
.TP
.B -v
specifies that
.I flex
should write to
.I stderr
a summary of statistics regarding the scanner it generates.
.TP
.B -F
specifies that the
.I fast
scanner table representation should be used. This representation is
about as fast as the full table representation
.RB ( \-f ),
and for some sets of patterns will be considerably smaller (and for
others, larger). See
.B flexdoc(1)
for details.
.IP
This option is equivalent to
.B -CF
(see below).
.TP
.B -I
instructs
.I flex
to generate an
.I interactive
scanner, that is, a scanner which stops immediately rather than
looking ahead if it knows
that the currently scanned text cannot be part of a longer rule's match.
Again, see
.B flexdoc(1)
for details.
.IP
Note,
.B -I
cannot be used in conjunction with
.I full
or
.I fast tables,
i.e., the
.B -f, -F, -Cf,
or
.B -CF
flags.
.TP
.B -L
instructs
.I flex
not to generate
.B #line
directives in
.B lex.yy.c.
The default is to generate such directives so error
messages in the actions will be correctly
located with respect to the original
.I flex
input file, and not to
the fairly meaningless line numbers of
.B lex.yy.c.
.TP
.B -T
makes
.I flex
run in
.I trace
mode. It will generate a lot of messages to
.I stdout
concerning
the form of the input and the resultant non-deterministic and deterministic
finite automata. This option is mostly for use in maintaining
.I flex.
.TP
.B -8
instructs
.I flex
to generate an 8-bit scanner.
On some sites, this is the default. On others, the default
is 7-bit characters. To see which is the case, check the verbose
.B (-v)
output for "equivalence classes created". If the denominator of
the number shown is 128, then by default
.I flex
is generating 7-bit characters. If it is 256, then the default is
8-bit characters.
.TP
.B -C[efmF]
controls the degree of table compression.
.IP
.B -Ce
directs
.I flex
to construct
.I equivalence classes,
i.e., sets of characters
which have identical lexical properties.
Equivalence classes usually give
dramatic reductions in the final table/object file sizes (typically
a factor of 2-5) and are pretty cheap performance-wise (one array
look-up per character scanned).
.IP
.B -Cf
specifies that the
.I full
scanner tables should be generated -
.I flex
should not compress the
tables by taking advantages of similar transition functions for
different states.
.IP
.B -CF
specifies that the alternate fast scanner representation (described in
.B flexdoc(1))
should be used.
.IP
.B -Cm
directs
.I flex
to construct
.I meta-equivalence classes,
which are sets of equivalence classes (or characters, if equivalence
classes are not being used) that are commonly used together. Meta-equivalence
classes are often a big win when using compressed tables, but they
have a moderate performance impact (one or two "if" tests and one
array look-up per character scanned).
.IP
A lone
.B -C
specifies that the scanner tables should be compressed but neither
equivalence classes nor meta-equivalence classes should be used.
.IP
The options
.B -Cf
or
.B -CF
and
.B -Cm
do not make sense together - there is no opportunity for meta-equivalence
classes if the table is not being compressed. Otherwise the options
may be freely mixed.
.IP
The default setting is
.B -Cem,
which specifies that
.I flex
should generate equivalence classes
and meta-equivalence classes. This setting provides the highest
degree of table compression. You can trade off
faster-executing scanners at the cost of larger tables with
the following generally being true:
.nf
slowest & smallest
-Cem
-Cm
-Ce
-C
-C{f,F}e
-C{f,F}
fastest & largest
.fi
.IP
.B -C
options are not cumulative; whenever the flag is encountered, the
previous -C settings are forgotten.
.TP
.B -Sskeleton_file
overrides the default skeleton file from which
.I flex
constructs its scanners. You'll never need this option unless you are doing
.I flex
maintenance or development.
.SH SUMMARY OF FLEX REGULAR EXPRESSIONS
The patterns in the input are written using an extended set of regular
expressions. These are:
.nf
x match the character 'x'
. any character except newline
[xyz] a "character class"; in this case, the pattern
matches either an 'x', a 'y', or a 'z'
[abj-oZ] a "character class" with a range in it; matches
an 'a', a 'b', any letter from 'j' through 'o',
or a 'Z'
[^A-Z] a "negated character class", i.e., any character
but those in the class. In this case, any
character EXCEPT an uppercase letter.
[^A-Z\\n] any character EXCEPT an uppercase letter or
a newline
r* zero or more r's, where r is any regular expression
r+ one or more r's
r? zero or one r's (that is, "an optional r")
r{2,5} anywhere from two to five r's
r{2,} two or more r's
r{4} exactly 4 r's
{name} the expansion of the "name" definition
(see above)
"[xyz]\\"foo"
the literal string: [xyz]"foo
\\X if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v',
then the ANSI-C interpretation of \\x.
Otherwise, a literal 'X' (used to escape
operators such as '*')
\\123 the character with octal value 123
\\x2a the character with hexadecimal value 2a
(r) match an r; parentheses are used to override
precedence (see below)
rs the regular expression r followed by the
regular expression s; called "concatenation"
r|s either an r or an s
r/s an r but only if it is followed by an s. The
s is not part of the matched text. This type
of pattern is called as "trailing context".
^r an r, but only at the beginning of a line
r$ an r, but only at the end of a line. Equivalent
to "r/\\n".
<s>r an r, but only in start condition s (see
below for discussion of start conditions)
<s1,s2,s3>r
same, but in any of start conditions s1,
s2, or s3
<<EOF>> an end-of-file
<s1,s2><<EOF>>
an end-of-file when in start condition s1 or s2
.fi
The regular expressions listed above are grouped according to
precedence, from highest precedence at the top to lowest at the bottom.
Those grouped together have equal precedence.
.LP
Some notes on patterns:
.IP -
Negated character classes
.I match newlines
unless "\\n" (or an equivalent escape sequence) is one of the
characters explicitly present in the negated character class
(e.g., "[^A-Z\\n]").
.IP -
A rule can have at most one instance of trailing context (the '/' operator
or the '$' operator). The start condition, '^', and "<<EOF>>" patterns
can only occur at the beginning of a pattern, and, as well as with '/' and '$',
cannot be grouped inside parentheses. The following are all illegal:
.nf
foo/bar$
foo|(bar$)
foo|^bar
<sc1>foo<sc2>bar
.fi
.SH SUMMARY OF SPECIAL ACTIONS
In addition to arbitrary C code, the following can appear in actions:
.IP -
.B ECHO
copies yytext to the scanner's output.
.IP -
.B BEGIN
followed by the name of a start condition places the scanner in the
corresponding start condition.
.IP -
.B REJECT
directs the scanner to proceed on to the "second best" rule which matched the
input (or a prefix of the input).
.B yytext
and
.B yyleng
are set up appropriately. Note that
.B REJECT
is a particularly expensive feature in terms scanner performance;
if it is used in
.I any
of the scanner's actions it will slow down
.I all
of the scanner's matching. Furthermore,
.B REJECT
cannot be used with the
.I -f
or
.I -F
options.
.IP
Note also that unlike the other special actions,
.B REJECT
is a
.I branch;
code immediately following it in the action will
.I not
be executed.
.IP -
.B yymore()
tells the scanner that the next time it matches a rule, the corresponding
token should be
.I appended
onto the current value of
.B yytext
rather than replacing it.
.IP -
.B yyless(n)
returns all but the first
.I n
characters of the current token back to the input stream, where they
will be rescanned when the scanner looks for the next match.
.B yytext
and
.B yyleng
are adjusted appropriately (e.g.,
.B yyleng
will now be equal to
.I n
).
.IP -
.B unput(c)
puts the character
.I c
back onto the input stream. It will be the next character scanned.
.IP -
.B input()
reads the next character from the input stream (this routine is called
.B yyinput()
if the scanner is compiled using
.B C++).
.IP -
.B yyterminate()
can be used in lieu of a return statement in an action. It terminates
the scanner and returns a 0 to the scanner's caller, indicating "all done".
.IP
By default,
.B yyterminate()
is also called when an end-of-file is encountered. It is a macro and
may be redefined.
.IP -
.B YY_NEW_FILE
is an action available only in <<EOF>> rules. It means "Okay, I've
set up a new input file, continue scanning".
.IP -
.B yy_create_buffer( file, size )
takes a
.I FILE
pointer and an integer
.I size.
It returns a YY_BUFFER_STATE
handle to a new input buffer large enough to accomodate
.I size
characters and associated with the given file. When in doubt, use
.B YY_BUF_SIZE
for the size.
.IP -
.B yy_switch_to_buffer( new_buffer )
switches the scanner's processing to scan for tokens from
the given buffer, which must be a YY_BUFFER_STATE.
.IP -
.B yy_delete_buffer( buffer )
deletes the given buffer.
.SH VALUES AVAILABLE TO THE USER
.IP -
.B char *yytext
holds the text of the current token. It may not be modified.
.IP -
.B int yyleng
holds the length of the current token. It may not be modified.
.IP -
.B FILE *yyin
is the file which by default
.I flex
reads from. It may be redefined but doing so only makes sense before
scanning begins. Changing it in the middle of scanning will have
unexpected results since
.I flex
buffers its input. Once scanning terminates because an end-of-file
has been seen,
.B
void yyrestart( FILE *new_file )
may be called to point
.I yyin
at the new input file.
.IP -
.B FILE *yyout
is the file to which
.B ECHO
actions are done. It can be reassigned by the user.
.IP -
.B YY_CURRENT_BUFFER
returns a
.B YY_BUFFER_STATE
handle to the current buffer.
.SH MACROS THE USER CAN REDEFINE
.IP -
.B YY_DECL
controls how the scanning routine is declared.
By default, it is "int yylex()", or, if prototypes are being
used, "int yylex(void)". This definition may be changed by redefining
the "YY_DECL" macro. Note that
if you give arguments to the scanning routine using a
K&R-style/non-prototyped function declaration, you must terminate
the definition with a semi-colon (;).
.IP -
The nature of how the scanner
gets its input can be controlled by redefining the
.B YY_INPUT
macro.
YY_INPUT's calling sequence is "YY_INPUT(buf,result,max_size)". Its
action is to place up to
.I max_size
characters in the character array
.I buf
and return in the integer variable
.I result
either the
number of characters read or the constant YY_NULL (0 on Unix systems)
to indicate EOF. The default YY_INPUT reads from the
global file-pointer "yyin".
A sample redefinition of YY_INPUT (in the definitions
section of the input file):
.nf
%{
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) \\
{ \\
int c = getchar(); \\
result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \\
}
%}
.fi
.IP -
When the scanner receives an end-of-file indication from YY_INPUT,
it then checks the
.B yywrap()
function. If
.B yywrap()
returns false (zero), then it is assumed that the
function has gone ahead and set up
.I yyin
to point to another input file, and scanning continues. If it returns
true (non-zero), then the scanner terminates, returning 0 to its
caller.
.IP
The default
.B yywrap()
always returns 1. Presently, to redefine it you must first
"#undef yywrap", as it is currently implemented as a macro. It is
likely that
.B yywrap()
will soon be defined to be a function rather than a macro.
.IP -
YY_USER_ACTION
can be redefined to provide an action
which is always executed prior to the matched rule's action.
.IP -
The macro
.B YY_USER_INIT
may be redefined to provide an action which is always executed before
the first scan.
.IP -
In the generated scanner, the actions are all gathered in one large
switch statement and separated using
.B YY_BREAK,
which may be redefined. By default, it is simply a "break", to separate
each rule's action from the following rule's.
.SH FILES
.TP
.I flex.skel
skeleton scanner.
.TP
.I lex.yy.c
generated scanner (called
.I lexyy.c
on some systems).
.TP
.I lex.backtrack
backtracking information for
.B -b
flag (called
.I lex.bck
on some systems).
.TP
.B -lfl
library with which to link the scanners.
.SH "SEE ALSO"
.LP
flexdoc(1), lex(1), yacc(1), sed(1), awk(1).
.LP
M. E. Lesk and E. Schmidt,
.I LEX - Lexical Analyzer Generator
.SH DIAGNOSTICS
.I reject_used_but_not_detected undefined
or
.LP
.I yymore_used_but_not_detected undefined -
These errors can occur at compile time. They indicate that the
scanner uses
.B REJECT
or
.B yymore()
but that
.I flex
failed to notice the fact, meaning that
.I flex
scanned the first two sections looking for occurrences of these actions
and failed to find any, but somehow you snuck some in (via a #include
file, for example). Make an explicit reference to the action in your
.I flex
input file. (Note that previously
.I flex
supported a
.B %used/%unused
mechanism for dealing with this problem; this feature is still supported
but now deprecated, and will go away soon unless the author hears from
people who can argue compellingly that they need it.)
.LP
.I flex scanner jammed -
a scanner compiled with
.B -s
has encountered an input string which wasn't matched by
any of its rules.
.LP
.I flex input buffer overflowed -
a scanner rule matched a string long enough to overflow the
scanner's internal input buffer (16K bytes - controlled by
.B YY_BUF_MAX
in "flex.skel").
.LP
.I scanner requires -8 flag -
Your scanner specification includes recognizing 8-bit characters and
you did not specify the -8 flag (and your site has not installed flex
with -8 as the default).
.LP
.I
fatal flex scanner internal error--end of buffer missed -
This can occur in an scanner which is reentered after a long-jump
has jumped out (or over) the scanner's activation frame. Before
reentering the scanner, use:
.nf
yyrestart( yyin );
.fi
.LP
.I too many %t classes! -
You managed to put every single character into its own %t class.
.I flex
requires that at least one of the classes share characters.
.SH AUTHOR
Vern Paxson, with the help of many ideas and much inspiration from
Van Jacobson. Original version by Jef Poskanzer.
.LP
See flexdoc(1) for additional credits and the address to send comments to.
.SH DEFICIENCIES / BUGS
.LP
Some trailing context
patterns cannot be properly matched and generate
warning messages ("Dangerous trailing context"). These are
patterns where the ending of the
first part of the rule matches the beginning of the second
part, such as "zx*/xy*", where the 'x*' matches the 'x' at
the beginning of the trailing context. (Note that the POSIX draft
states that the text matched by such patterns is undefined.)
.LP
For some trailing context rules, parts which are actually fixed-length are
not recognized as such, leading to the abovementioned performance loss.
In particular, parts using '|' or {n} (such as "foo{3}") are always
considered variable-length.
.LP
Combining trailing context with the special '|' action can result in
.I fixed
trailing context being turned into the more expensive
.I variable
trailing context. For example, this happens in the following example:
.nf
%%
abc |
xyz/def
.fi
.LP
Use of unput() invalidates yytext and yyleng.
.LP
Use of unput() to push back more text than was matched can
result in the pushed-back text matching a beginning-of-line ('^')
rule even though it didn't come at the beginning of the line
(though this is rare!).
.LP
Pattern-matching of NUL's is substantially slower than matching other
characters.
.LP
.I flex
does not generate correct #line directives for code internal
to the scanner; thus, bugs in
.I flex.skel
yield bogus line numbers.
.LP
Due to both buffering of input and read-ahead, you cannot intermix
calls to <stdio.h> routines, such as, for example,
.B getchar(),
with
.I flex
rules and expect it to work. Call
.B input()
instead.
.LP
The total table entries listed by the
.B -v
flag excludes the number of table entries needed to determine
what rule has been matched. The number of entries is equal
to the number of DFA states if the scanner does not use
.B REJECT,
and somewhat greater than the number of states if it does.
.LP
.B REJECT
cannot be used with the
.I -f
or
.I -F
options.
.LP
Some of the macros, such as
.B yywrap(),
may in the future become functions which live in the
.B -lfl
library. This will doubtless break a lot of code, but may be
required for POSIX-compliance.
.LP
The
.I flex
internal algorithms need documentation.

2441
man/man1/flexdoc.1 Normal file

File diff suppressed because it is too large Load diff

26
man/man1/fmt.1 Normal file
View file

@ -0,0 +1,26 @@
.TH FMT 1
.SH NAME
fmt - adjust line-length for paragraphs of text
.SH SYNOPSIS
\fBfmt\fP [\-\fIwidth\fP] [\fIfiles\fP]...
.SH DESCRIPTION
\fIfmt\fR is a simple text formatter.
It inserts or deletes newlines, as necessary, to make all lines in a
paragraph be approximately the same width.
It preserves indentation and word spacing.
.PP
The default line width is 72 characters.
You can override this with the \-\fIwidth\fR flag.
If you don't name any files on the command line,
then \fIfmt\fR will read from stdin.
.PP
It is typically used from within \fIvi\fR to adjust the line breaks
in a single paragraph.
To do this, move the cursor to the top of the paragraph,
type "!}fmt", and
hit <Return>.
.SH AUTHOR
.nf
Steve Kirkendall
kirkenda@cs.pdx.edu
.fi

29
man/man1/fold.1 Normal file
View file

@ -0,0 +1,29 @@
.TH FOLD 1
.SH NAME
fold \- fold long lines
.SH SYNOPSIS
\fBfold\fR [\fB\-\fIn\fR]\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-\fIn\fR" "How long should the output lines be"
.SH EXAMPLES
.EX "fold \-60" "Fold \fIstdin\fR to 60 characters"
.EX "fold file" "Fold \fIfile\fP to 80 characters"
.SH DESCRIPTION
.PP
\fIFold\fR takes copies its input from the named file (or \fIstdin\fR,
if none is specified) to standard output.
However, lines longer than the given maximum (default 80) are broken
into multiple lines of the maximum length by inserting new line characters.
.SH "SEE ALSO"
.BR width (1).

67
man/man1/format.1 Normal file
View file

@ -0,0 +1,67 @@
.TH FORMAT 1
.SH NAME
format \- format a PC floppy diskette
.SH SYNOPSIS
.B format
.RB [ \-v ]
.I device
.RI [ media-size
.RI [ drive-size ]]
.SH DESCRIPTION
.de SP
.if t .sp 0.4
.if n .sp
..
.B Format
allows a user with read-write permission to
.I device
to format a floppy. Either one of the special floppy devices must be used,
see
.BR fd (4),
or an automatic device may be used with the size of the floppy specified on
the command line. Two sizes must be given when formatting a low density
diskette in a high density drive. For example:
.PP
.RS
.ft B
.nf
format /dev/at1
format /dev/fd1 1200
format /dev/fd1 360 1200
.fi
.ft P
.RE
.PP
The first two commands format a 1.2M diskette, the last formats a 360k
diskette in a 1.2M drive. A 1.44M drive knows when it's dealing with a low
density floppy, so all these commands format a 720k diskette:
.PP
.RS
.ft B
.nf
format /dev/fd0 720
format /dev/fd0 720 1440
format /dev/ps0
.fi
.ft P
.RE
.PP
No sizes may be specified when using a special floppy device, a size must be
specified when using an automatic device.
.SH OPTIONS
.TP
.B \-v
Verify the process by reading each track after formatting it. Formatting is
normally blind, the controller has no idea whether it succeeds or not. Use
.B \-v
on a new box of cheap diskettes, or on a diskette that may have gone bad.
Verifying will increase formatting time by 50%.
.SH "SEE ALSO"
.BR mkfs (1),
.BR fd (4).
.SH DIAGNOSTICS
Numbers will be printed on standard output to show that it is busy. The
locations of bad sectors are printed on standard error when verifying. The
exit code is zero unless there are too many bad spots.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

23
man/man1/fortune.1 Normal file
View file

@ -0,0 +1,23 @@
.TH FORTUNE 1
.SH NAME
fortune \- print a fortune
.SH SYNOPSIS
\fBfortune\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "fortune" "Print a fortune"
.SH DESCRIPTION
.PP
\fIFortune\fR prints a fortune at random from the fortunes file,
\fI/usr/lib/fortune.dat\fR. This file consists of pieces
of text separated by a line containing only %%.

51
man/man1/fsck.1 Normal file
View file

@ -0,0 +1,51 @@
.TH FSCK 1
.SH NAME
fsck, fsck1 \- perform file system consistency check
.SH SYNOPSIS
\fBfsck\fR [\fB\-aclmrs\fR]\fR [\fIdevice\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-a" "Automatically repair inconsistencies"
.FL "\-c" "Check and list only the specified i-nodes
.FL "\-l" "List the files and directories in the filesytem
.FL "\-r" "Prompt user for repairs if inconsistencies are found
.FL "\-s" "List the superblock of the file system"
.SH EXAMPLES
.EX "fsck /dev/hd4" "Check file system on \fI/dev/hd4\fR"
.EX "fsck \-a /dev/at0" "Automatically fix errors on \fI/dev/at0\fR"
.EX "fsck \-l /dev/fd0" "List the contents of \fI/dev/fd0\fR"
.EX "fsck \-c 2 3 /dev/hd3" "Check and list \fI/dev/hd3\fR i-nodes 2 & 3"
.SH DESCRIPTION
.PP
\fIFsck\fR performs consistency checks on the file systems which reside
on the specified devices.
\fIFsck1\fR is an alternate version for use on obsolete V1 file systems.
When either the \fB\-a\fR or \fB\-r\fR flags are given, the file system
will be repaired if errors are found.
Before running \fIfsck\fR on a mounted file system, it must first be unmounted.
Trying to repair a mounted file system is dangerous and should not be
attempted.
.PP
To repair the root file system (which cannot be unmounted), first
type CTRL-F9 at the console to kill any and all processes. Log back in
as \fBroot\fR, type \fIsync\fR to force any buffered changes to disk,
run \fIfsck\fR on the root file system and immediately reboot the
computer by typing \fIreboot\fR.
.PP
It is necessary to kill all processes before repairing the root file system
to prevent them from modifying any disk blocks while \fIfsck\fR is running.
This is only necessary for the root file system, any other file system can
simply be unmounted before it is checked.
.SH "SEE ALSO"
.BR mkfs (1),
.BR mount (1).

50
man/man1/grep.1 Normal file
View file

@ -0,0 +1,50 @@
.TH GREP 1
.SH NAME
grep \- search a file for lines containing a given pattern
.SH SYNOPSIS
\fBgrep\fR [\fB\-elnsv\fR] \fIpattern\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-e" "\fB\-e \fIpattern\fR is the same as \fIpattern\fP
.FL "\-c" "Print a count of lines matched"
.FL "\-i" "Ignore case"
.FL "\-l" "Print file names, no lines"
.FL "\-n" "Print line numbers"
.FL "\-s" "Status only, no printed output"
.FL "\-v" "Select lines that do not match"
.SH EXAMPLES
.EX "grep mouse file " "Find lines in \fIfile\fP containing \fImouse\fP"
.EX "grep [0\-9] file" "Print lines containing a digit"
.SH DESCRIPTION
.PP
.I Grep
searches one or more files (by default, \fIstdin\fR) and selects out
all the lines that match the pattern.
All the regular expressions accepted by
.I ed
and
.I mined
are allowed.
In addition, + can be used instead of \(** to mean 1 or more occurrences,
? can be used to mean 0 or 1 occurrences, and
| can be used between two regular expressions to mean either
one of them.
Parentheses can be used for grouping.
If a match is found, exit status 0 is returned.
If no match is found, exit status 1 is returned.
If an error is detected, exit status 2 is returned.
.SH "SEE ALSO"
.BR cgrep (1),
.BR fgrep (1),
.BR sed (1),
.BR awk (9).

28
man/man1/head.1 Normal file
View file

@ -0,0 +1,28 @@
.TH HEAD 1
.SH NAME
head \- print the first few lines of a file
.SH SYNOPSIS
\fBhead\fR [\fB\-\fIn\fR]\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-\fIn\fR" "How many lines to print"
.SH EXAMPLES
.EX "head \-6" "Print first 6 lines of \fIstdin\fR"
.EX "head \-1 file1 file2" "Print first line of two files"
.SH DESCRIPTION
.PP
The first few lines of one or more files are printed.
The default count is 10 lines.
The default file is \fIstdin\fR.
.SH "SEE ALSO"
.BR tail (1).

207
man/man1/host.1 Normal file
View file

@ -0,0 +1,207 @@
.\" ++Copyright++ 1993
.\" -
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\" -
.\" Portions Copyright (c) 1993 by Digital Equipment Corporation.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies, and that
.\" the name of Digital Equipment Corporation not be used in advertising or
.\" publicity pertaining to distribution of the document or software without
.\" specific, written prior permission.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
.\" WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
.\" CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\" -
.\" --Copyright--
.\" $Id$
.TH HOST 1
.SH NAME
host \- look up host names using domain server
.SH SYNOPSIS
host [-l] [-v] [-w] [-r] [-d] [-t querytype] [-a] host [ server ]
.SH DESCRIPTION
.I Host
looks for information about Internet hosts. It gets this information
from a set of interconnected servers that are spread across the
country. By default, it simply converts between host names and
Internet addresses. However with the -t or -a options, it can be used
to find all of the information about this host that is maintained
by the domain server.
.PP
The arguments can be either host names or host numbers. The program
first attempts to interpret them as host numbers. If this fails,
it will treat them as host names. A host number consists of
first decimal numbers separated by dots, e.g. 128.6.4.194
A host name
consists of names separated by dots, e.g. topaz.rutgers.edu.
Unless the name ends in a dot, the local domain
is automatically tacked on the end. Thus a Rutgers user can say
"host topaz", and it will actually look up "topaz.rutgers.edu".
If this fails, the name is tried unchanged (in this case, "topaz").
This same convention is used for mail and other network utilities.
The actual suffix to tack on the end is obtained
by looking at the results of a "hostname" call, and using everything
starting at the first dot. (See below for a description of
how to customize the host name lookup.)
.PP
The first argument is the host name you want to look up.
If this is a number, an "inverse query" is done, i.e. the domain
system looks in a separate set of databases used to convert numbers
to names.
.PP
The second argument is optional. It
allows you to specify a particular server to query. If you don't
specify this argument, the default server (normally the local machine)
is used.
.PP
If a name is specified, you may see output of three different kinds.
Here is an example that shows all of them:
.br
% host sun4
.br
sun4.rutgers.edu is a nickname for ATHOS.RUTGERS.EDU
.br
ATHOS.RUTGERS.EDU has address 128.6.5.46
.br
ATHOS.RUTGERS.EDU has address 128.6.4.4
.br
ATHOS.RUTGERS.EDU mail is handled by ARAMIS.RUTGERS.EDU
.br
The user has typed the command "host sun4". The first line indicates
that the name "sun4.rutgers.edu" is actually a nickname. The official
host name is "ATHOS.RUTGERS.EDU'. The next two lines show the
address. If a system has more than one network interface, there
will be a separate address for each. The last line indicates
that ATHOS.RUTGERS.EDU does not receive its own mail. Mail for
it is taken by ARAMIS.RUTGERS.EDU. There may be more than one
such line, since some systems have more than one other system
that will handle mail for them. Technically, every system that
can receive mail is supposed to have an entry of this kind. If
the system receives its own mail, there should be an entry
the mentions the system itself, for example
"XXX mail is handled by XXX". However many systems that receive
their own mail do not bother to mention that fact. If a system
has a "mail is handled by" entry, but no address, this indicates
that it is not really part of the Internet, but a system that is
on the network will forward mail to it. Systems on Usenet, Bitnet,
and a number of other networks have entries of this kind.
.PP
There are a number of options that can be used before the
host name. Most of these options are meaningful only to the
staff who have to maintain the domain database.
.PP
The option -w causes host to wait forever for a response. Normally
it will time out after around a minute.
.PP
The option -v causes printout to be in a "verbose" format. This
is the official domain master file format, which is documented
in the man page for "named". Without this option, output still follows
this format in general terms, but some attempt is made to make it
more intelligible to normal users. Without -v,
"a", "mx", and "cname" records
are written out as "has address", "mail is handled by", and
"is a nickname for", and TTL and class fields are not shown.
.PP
The option -r causes recursion to be turned off in the request.
This means that the name server will return only data it has in
its own database. It will not ask other servers for more
information.
.PP
The option -d turns on debugging. Network transactions are shown
in detail.
.PP
The option -t allows you to specify a particular type of information
to be looked up. The arguments are defined in the man page for
"named". Currently supported types are a, ns, md, mf, cname,
soa, mb, mg, mr, null, wks, ptr, hinfo, minfo, mx, uinfo,
uid, gid, unspec, and the wildcard, which may be written
as either "any" or "*". Types must be given in lower case.
Note that the default is to look first for "a", and then "mx", except
that if the verbose option is turned on, the default is only "a".
.PP
The option -a (for "all") is equivalent to "-v -t any".
.PP
The option -l causes a listing of a complete domain. E.g.
.br
host -l rutgers.edu
.br
will give a listing of all hosts in the rutgers.edu domain. The -t
option is used to filter what information is presented, as you
would expect. The default is address information, which also
include PTR and NS records. The command
.br
host -l -v -t any rutgers.edu
.br
will give a complete download of the zone data for rutgers.edu,
in the official master file format. (However the SOA record is
listed twice, for arcane reasons.) NOTE: -l is implemented by
doing a complete zone transfer and then filtering out the information
the you have asked for. This command should be used only if it
is absolutely necessary.
.SH CUSTOMIZING HOST NAME LOOKUP
In general, if the name supplied by the user does not
have any dots in it, a default domain is appended to the end.
This domain can be defined in /etc/resolv.conf, but is normally derived
by taking the local hostname after its first dot. The user can override
this, and specify a different default domain, using the environment
variable
.IR LOCALDOMAIN .
In addition, the user can supply his own abbreviations for host names.
They should be in a file consisting of one line per abbreviation.
Each line contains an abbreviation, a space, and then the full
host name. This file must be pointed to by an environment variable
.IR HOSTALIASES ,
which is the name of the file.
.SH "See Also"
named (8)
.SH BUGS
Unexpected effects can happen when you type a name that is not
part of the local domain. Please always keep in mind the
fact that the local domain name is tacked onto the end of every
name, unless it ends in a dot. Only if this fails is the name
used unchanged.
.PP
The -l option only tries the first name server listed for the
domain that you have requested. If this server is dead, you
may need to specify a server manually. E.g. to get a listing
of foo.edu, you could try "host -t ns foo.edu" to get a list
of all the name servers for foo.edu, and then try "host -l foo.edu xxx"
for all xxx on the list of name servers, until you find one that
works.

43
man/man1/hostaddr.1 Normal file
View file

@ -0,0 +1,43 @@
.TH HOSTADDR 1
.SH NAME
hostaddr \- show ethernet address, IP address or hostname
.SH SYNOPSIS
.B hostaddr
.RB [ \-eiah ]
.RB [ \-E
.IR eth-device ]
.RB [ \-I
.IR ip-device ]
.SH DESCRIPTION
Without any of the
.B \-eia
options,
.B hostaddr
shows the ethernet address, IP address and hostname of the local host on one
line in the given order. With options only the wanted fields are shown,
still in the same order, not in option order.
.SH OPTIONS
.TP
.B \-e
Show the ethernet address.
.TP
.B \-i
Show the IP address.
.TP
.B \-a
Show the fully qualified hostname. The IP address is shown if it
can't be translated to a host name. This usually indicates that the
DNS reverse address translation tables are incomplete or that
the name daemon couldn't be contacted.
.TP
.B \-h
Set the hostname of the machine if the caller is the superuser. (Used at
boot time by the network initialization scripts.)
.SH "SEE ALSO"
.BR ifconfig (8),
.BR dhcpd (8),
.BR nonamed (8),
.BR inet (8),
.BR boot (8).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

29
man/man1/id.1 Normal file
View file

@ -0,0 +1,29 @@
.TH ID 1
.SH NAME
id \- print the uid and gid
.SH SYNOPSIS
\fBid\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "id" "Print the uid and gid"
.SH DESCRIPTION
.PP
\fIId\fR prints the current uid and gid, both numerically and symbolically.
If the effective uid and gid are different from the real ones, all of them
are printed.
.PP
Under Minix-vmd the supplementary group IDs are also printed.
.SH "SEE ALSO"
.BR getuid (2),
.BR getgid (2),
.BR getgroups (2).

44
man/man1/ifdef.1 Normal file
View file

@ -0,0 +1,44 @@
.TH IFDEF 1
.SH NAME
ifdef \- remove #ifdefs from a file
.SH SYNOPSIS
\fBifdef \fR[\fB\-t\fR] [\fB\-d\fIsymbol\fR] [\fB\-D\fIsymbol\fR] [\fB\-U\fIsymbol\fR] [\fB\-I\fIsymbol\fR] [file]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-D" "Define symbol permanently"
.FL "\-I" "Ignore symbol"
.FL "\-U" "Undefine symbol permanently"
.FL "\-d" "Define symbol. It may be #undef'ed later"
.FL "\-t" "Produce a table of the symbols on \fIstdout\fR"
.SH EXAMPLES
.EX "ifdef \-DUNIX file.c >newfile.c" "Define \fIUNIX\fR"
.EX "ifdef \-D_MINIX \-UDOS <x.c >y.c "Define \fI_MINIX\fR, undefine \fIDOS\fR"
.SH DESCRIPTION
.PP
\fIIfdef\fR
allows conditional code [ #ifdef ... #endif ]
to be selectively removed from C files, but at the same time leaving
all other C preprocessor commands intact such as #define, #include etc.
Input to
.I ifdef
is either the file named as the last argument, or \fIstdin\fR if no file
is named.
Output goes to \fIstdout\fR.
.PP
Symbols may be defined with the \fB\-d\fR or \fB\-D\fR flags just like
\fIcpp\fR, except that the latter option ignores subsequent \fI#undefs\fR.
It is not permitted to give values to symbols.
Similarly, \fB\-U\fR undefines a symbol and ignores subsequent
\fI#defines\fRs.
Symbols defined with \fB\-I\fR are ignored; any \fI#ifdef\fR using an
ignored symbol will be left intact.

177
man/man1/install.1 Normal file
View file

@ -0,0 +1,177 @@
.TH INSTALL 1
.SH NAME
install \- install files
.SH SYNOPSIS
.in +5
.ti -5
.B install
.RB [ \-lcsz\fIN\fP "] [" \-o
.IR owner ]
.RB [ \-g
.IR group ]
.RB [ \-m
.IR mode ]
.RB [ \-S
.IR stack ]
.RI [ file1 ]
.I file2
.br
.ti -5
.B install
.RB [ \-lcsz\fIN\fP "] [" \-o
.IR owner ]
.RB [ \-g
.IR group ]
.RB [ \-m
.IR mode ]
.RB [ \-S
.IR stack ]
.IR file " ... " dir
.br
.ti -5
.B install \-d
.RB [ \-o
.IR owner ]
.RB [ \-g
.IR group ]
.RB [ \-m
.IR mode ]
.I directory
.in -5
.SH DESCRIPTION
.de SP
.if t .sp 0.4
.if n .sp
..
.B Install
puts executables, manual pages, and library files in their proper place
in the bin, man, and lib directories. The first two forms of the
command are like
.BR cp (1)
copying either one file to another or copying several files to a
directory. The "\fB\-d\fP" form is like
.BR mkdir (1)
with the
.B \-p
flag.
.I File1
may be omitted if neither
.B \-l
nor
.B \-c
is given to change the attributes of
.IR file2 .
.PP
Attributes are always copied from the source file, use the options to change.
Note that the source file's attributes are changed with the destination file
if they are linked. So copy the file if you change it in a way that makes
it read-only. You would otherwise not be able to compile a command again.
.SH OPTIONS
.TP
.B \-l
Link the destination to the source file instead of copying it. This is done
to either save space on a file system with both the source and the bin
directories on it, or to install synonyms to a command.
.TP
.B \-c
Copy the source file to its proper place. This option is the default if
.B \-l
is not given. With
.BR \-l ,
the file is copied if the link fails.
.TP
.B \-s
Strip the destination file of its symbol table,
.I if
it is an executable, and
.I if
it is actually copied. It has no effect on a link or a non-executable.
.TP
.B \-z
Compress the executable using
.BR compress (1)
and prepend a header line that calls
.BR zexec (1)
to decompress and execute the binary. This will on average save 40% disk
space at the expense of a slower startup time. Like
.B \-s
the file must be actually copied for the flag to have effect.
.TP
.BI \- N
Use
.BI "gzip \-" N
to compress the binary. You may see up to 60% space savings, but it will
take much longer.
.I N
is a digit from 1 to 9 telling the compression effort, see
.BR gzip (1).
.TP
.B \-d
Make a directory, usually to install files in a separate directory in a
library. Intermediate directories in the path are created with the same
attributes as the final directory. Only the attributes of the final
directory are set if the directory exists.
.TP
.BI \-o " owner"
Set the owner of the target. This only works if the invoker is the
super-user, or if
.B install
is run setuid root and the invoker is a member of group zero. If
.B \-o
is omitted then the ownership is copied from the source file, or set to
the id of the invoker if a directory is made.
.TP
.BI \-g " group"
Like
.BR \-o ,
but for the group ownership of the target.
.TP
.BI \-m " mode"
.I Mode
is an octal number that specifies the mode the target should get. The
default is the source file's mode with a
.B chmod a+rX
applied to it, or 755 for a new directory. Implies
.BR "\-o 0" ,
or
.BR "\-g 0"
if a file is to be set-uid or set-gid and the invoker has permission to
change ownership. This trick allows a group 0 member to install third party
software, even though it expects to be installed by root.
.TP
.BI \-S " stack"
Sets the maximum amount of heap + stack that an executable may have when
running. The argument is a C-style decimal, octal or hexadecimal
number, optionally followed by the multipliers
.BR m ,
.BR k ,
.BR w ,
and
.B b
for mega (1024*1024), kilo (1024), "word" (2 or 4), and byte (1). Uppercase
.B M
is also accepted for those who know what S.I. means. The compilers use
.B \-S 32kw
by default, that translates to 64kb for an 8086, and 128kb for other
architectures. This option is ignored on a non-executable.
.SH "SEE ALSO"
.BR ln (1),
.BR cp (1),
.BR strip (1),
.BR compress (1),
.BR gzip (1),
.BR zexec (1),
.BR chown (8),
.BR chgrp (1),
.BR chmod (1),
.BR chmem (1),
.BR mkdir (1).
.SH BUGS
Uppercase
.BR K ,
.BR W ,
and
.B B
are also accepted for those who don't know what S.I. means.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

29
man/man1/isodir.1 Normal file
View file

@ -0,0 +1,29 @@
.TH ISODIR 1
.SH NAME
isodir \- list ISO9660 or High Sierra directories
.SH SYNOPSIS
\fBisodir\fP \-[\fBlr\fP] \fIinput_file\fP [\fIdir\fP]
.SH DESCRIPTION
\fBIsodir\fP reads directories on a file system in ISO9660 or High Sierra
Group format (usually residing on cdrom) and lists their contents on
standard output. Directory names should contain slashes to separate
components. The names \fBisodir\fP, \fBisoread\fP, and \fBisoinfo\fP are all
links to the same program. The program sees which function to perform by
looking how it was called.
.PP
.IP \-l
Lists all info on files and directories (size, date, time)
.IP \-r
Recursively descend and print subdirectories
.IP \-B
List the byte offset and size of a file or directory. (Useful in scripts that
want to operate on an ISO image file. To add a Minix partition table, for
instance.)
.SH "BUGS"
Only Interchange level-1 is supported. The Red Rock extensions and Interchange
level-2 are not implemented.
.SH "SEE ALSO"
.BR isoread (1),
.BR isoinfo (1).
.SH AUTHOR
Michel R. Prevenier (mrpreve@cs.vu.nl)

19
man/man1/isoinfo.1 Normal file
View file

@ -0,0 +1,19 @@
.TH ISOINFO 1
.SH NAME
isoinfo \- list an ISO9660 or High Sierra volume descriptor
.SH SYNOPSIS
\fBisoinfo\fP [\fIinput_file\fP]
.SH DESCRIPTION
\fBIsoinfo\fP reads the volume descriptor from an ISO9660 or High Sierra
Group file system (usually residing on cdrom) and lists its contents on
standard output. \fBisodir\fP, \fBisoread\fP, and \fBisoinfo\fP are all
links to the same program. The program sees which function to perform by
looking how it was called.
.SH "BUGS"
Only Interchange level-1 is supported. The Red Rock extensions and Interchange
level-2 are not implemented.
.SH "SEE ALSO"
.BR isodir (1),
.BR isoread (1).
.SH AUTHOR
Michel R. Prevenier (mrpreve@cs.vu.nl)

27
man/man1/isoread.1 Normal file
View file

@ -0,0 +1,27 @@
.TH ISOREAD 1
.SH NAME
isoread \- read a file in ISO9660 or High Sierra format
.SH SYNOPSIS
\fBisoread\fP \-[\fBa\fP] [\fIinput_file\fP] \fIfile\fP
.SH DESCRIPTION
\fBIsoread\fP reads a file in ISO9660 or High Sierra Group format (usually
residing on cdrom) and lists its contents on standard output. The file path
should contain slashes to separate components. The names \fBisodir\fP,
\fBisoread\fP, and \fBisoinfo\fP are all links to the same program. The
program sees which function to perform by looking how it was called.
.PP
.IP \-a
(ASCII) -- convert MS-DOS text files to UNIX-style text files by dropping
the ^M at the end of each line.
.IP \-B
List the byte offset and size of a file. (Useful in scripts that
want to operate on an ISO image file. To add a Minix partition table, for
instance.)
.SH "BUGS"
Only Interchange level-1 is supported. The Red Rock extensions and Interchange
level-2 are not implemented.
.SH "SEE ALSO"
.BR isodir (1),
.BR isoinfo (1).
.SH AUTHOR
Michel R. Prevenier (mrpreve@cs.vu.nl)

118
man/man1/join.1 Normal file
View file

@ -0,0 +1,118 @@
.\" @(#)join.1 6.1 (Berkeley) 4/29/85
.\"
.TH JOIN 1 "April 29, 1985"
.AT 3
.SH NAME
join \- relational database operator
.SH SYNOPSIS
.B join
.RB [ \-a\fIn ]
.RB [ \-e
.IR s ]
.RB [ \-o
.IR list ]
.RB [ \-t\fIc ]
file1 file2
.SH DESCRIPTION
.B Join
forms, on the standard output,
a join
of the two relations specified by the lines of
.I file1
and
.IR file2 .
If
.I file1
is `\-', the standard input is used.
.PP
.I File1
and
.I file2
must be sorted in increasing ASCII collating
sequence on the fields
on which they are to be joined,
normally the first in each line.
.PP
There is one line in the output
for each pair of lines in
.I file1
and
.I file2
that have identical join fields.
The output line normally consists of the common field,
then the rest of the line from
.IR file1 ,
then the rest of the line from
.IR file2 .
.PP
Fields are normally separated by blank, tab or newline.
In this case, multiple separators count as one, and
leading separators are discarded.
.PP
These options are recognized:
.TP
.BI \-a n
In addition to the normal output,
produce a line for each unpairable line in file
.IR n ,
where
.I n
is 1 or 2.
.TP
.BI \-e " s"
Replace empty output fields by string
.IR s .
.ig
.TP
.BI \-j "n m"
Join on the
.IR m th
field of file
.IR n .
If
.I n
is missing, use the
.IR m th
field in each file.
..
.TP
.BI \-o " list"
Each output line comprises the fields specified in
.IR list ,
each element of which has the form
.IR n . m ,
where
.I n
is a file number and
.I m
is a field number.
.PP
.TP
.BI \-t c
Use character
.I c
as a separator (tab character).
Every appearance of
.I c
in a line is significant.
.SH "SEE ALSO"
.BR sort (1),
.BR comm (1),
.BR awk (1).
.SH BUGS
With default field separation,
the collating sequence is that of
.BR "sort \-b" ;
with
.BR \-t ,
the sequence is that of a plain sort.
.PP
The conventions of
.BR join ,
.BR sort ,
.BR comm ,
.BR uniq ,
.BR look
and
.BR awk (1)
are wildly incongruous.

35
man/man1/kill.1 Normal file
View file

@ -0,0 +1,35 @@
.TH KILL 1
.SH NAME
kill \- send a signal to a process
.SH SYNOPSIS
\fBkill\fR [\fB\-\fIn\fR] \fIprocess\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-\fIn\fR" "Signal number to send"
.FL "\-\fINAME\fR" "Named signal to send"
.SH EXAMPLES
.EX "kill 35" "Send signal 15 to process 35"
.EX "kill \-9 40" "Send signal 9 to process 40"
.EX "kill \-2 0" "Send signal 2 to whole terminal process group"
.EX "kill \-HUP -123" "Send a hangup to process group 123"
.SH DESCRIPTION
.PP
A signal is sent to a given process.
By default signal 15 (SIGTERM) is sent.
Process 0 means all the processes in the sender's process group.
A process group can be signalled by the negative value of the process
group ID.
Signals may be numerical, or the name of the signal without \fBSIG\fP.
.SH "SEE ALSO"
.BR kill (2),
.BR sigaction (2).

44
man/man1/last.1 Normal file
View file

@ -0,0 +1,44 @@
.TH LAST 1
.SH NAME
last, uptime \- display recent on-line session records, show uptime
.SH SYNOPSIS
\fBlast\fR [\fB\-f \fIfile\fR]\fR [\fB\-r\fR] [\fB\-\fIn\fR] [\fIname\fR] [\fItty\fR] ...\fR
.br
\fBuptime\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-f" "Use \fIfile\fR instead of /usr/adm/wtmp"
.FL "\-r" "Search backwards only to last reboot"
.FL "\-u" "Print uptime since last reboot"
.FL "\-\fIn\fP" "Print a maximum of \fIn\fR lines"
.SH EXAMPLES
.EX "last reboot" "When was the system last rebooted?"
.EX "last ast" "When was the last login for ast?"
.EX "last \-10 tty00 tty01" "Display last 10 logins on tty00 or tty01"
.EX "uptime" "Display uptime (likewise \fBlast \-u\fR)"
.SH DESCRIPTION
.PP
.I Last
Searches backward through the login administration file (default is
\fI/usr/adm/wtmp\fR), printing information about previous logins and
reboots.
During a long search, the SIGQUIT signal (CTRL-\\) causes \fIlast\fR to
display how far back it has gone; it then continues.
.PP
.IR Uptime ,
an alias for
.IR "last \-u" ,
displays the time the system is running since the last reboot.
.SH "SEE ALSO"
.BR who (1),
.BR utmp (5).

26
man/man1/leave.1 Normal file
View file

@ -0,0 +1,26 @@
.TH LEAVE 1
.SH NAME
leave \- warn when it is time to go home
.SH SYNOPSIS
\fBleave\fR [\fR [\fB+\fR] \fIhh\fR[\fB:\fR]\fImm\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "leave 1500" "Issue a warning at 2:55 p.m."
.EX "leave 10:00" "Issue a warning at 9:55 a.m."
.EX "leave + 30" "Issue a warning in 25 minutes"
.SH DESCRIPTION
.PP
\fILeave\fR sets an alarm clock to a specified time and issues a warning
5 minutes before, 1 minute before, and at the time to leave.
It then keeps issuing warnings every minute for 10 minutes, then quits.
If no time is provided, the program prompts for one.

37
man/man1/loadfont.1 Normal file
View file

@ -0,0 +1,37 @@
.TH LOADFONT 1
.SH NAME
loadfont \- load a font into the video card
.SH SYNOPSIS
\fBloadfont \fIfontfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "loadfont iso1.fnt" "Loads the ISO 8859-1 (Latin-1) font"
.SH DESCRIPTION
.PP
.I Loadfont
loads a custom font into the video card (EGA or VGA). The font character
size has to be 8x16 pixels and the font file must contain 256 characters for
a total size of 4 kilobytes.
.PP
.I Loadfont
together with
.I loadkeys
allow the console and keyboard to be customized to national conventions.
.PP
If it exists, the file
.I /etc/font
is loaded as a custom font by
.B /usr/etc/rc
at boot time.
.SH "SEE ALSO"
.BR console (4).

30
man/man1/loadkeys.1 Normal file
View file

@ -0,0 +1,30 @@
.TH LOADKEYS 1
.SH NAME
loadkeys \- load a keyboard map into the keyboard driver
.SH SYNOPSIS
\fBloadkeys \fImapfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "loadkeys spanish.map" "Load a map for a Spanish keyboard"
.SH DESCRIPTION
.PP
.I Loadkeys
changes the key number to character mapping. This is necessary for national
keyboards that have different symbols on the keys that the standard U.S.
English keyboard. The file
.I /etc/keymap
is the first thing loaded by
.I /etc/rc
at boot time if it exists.
.SH "SEE ALSO"
.BR console (4).

28
man/man1/login.1 Normal file
View file

@ -0,0 +1,28 @@
.TH LOGIN 1
.SH NAME
login \- log into the computer
.SH SYNOPSIS
\fBlogin\fR [\fIuser\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "login ast" "Login as ast"
.SH DESCRIPTION
.PP
\fILogin\fR allows a logged in user to login as someone else without first
logging out.
If a password is needed, \fIlogin\fR will prompt for it.
.SH "SEE ALSO"
.BR su (1),
.BR init (8),
.BR getty (8),
.BR rlogin (1).

38
man/man1/look.1 Normal file
View file

@ -0,0 +1,38 @@
.TH LOOK 1
.SH NAME
look \- find lines in a sorted list
.SH SYNOPSIS
.B look
.RB [ \-df ]
.I string
.RI [ file ]
.SH DESCRIPTION
.B Look
consults a sorted file and prints all lines that begin with
.IR string .
It uses binary search. The options
.B \-d
and
.B \-f
affect comparisons as in
.BR sort (1).
If no file is specified,
.B /usr/lib/dict/words
is assumed with collating sequence
.BR \-df .
.SH OPTIONS
.TP 5
.B \-d
Dictionary order: compare letters, digits and whitespace.
.TP 5
.B \-f
Fold. Upper case letters compare equal to lower case.
.SH FILES
.TP 25
.B /usr/lib/dict/words
Sorted list of English words.
.SH "SEE ALSO"
.BR sort (1),
.BR spell (1).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

59
man/man1/lp.1 Normal file
View file

@ -0,0 +1,59 @@
.TH LP 1
.SH NAME
lp, lpd \- copy a file to the line printer
.SH SYNOPSIS
.B lp
.RI [ file " ...]"
.SH DESCRIPTION
Each file argument to
.B lp
is send to the line printer to be printed. Standard input is read and
printed if there are no arguments.
.B Lp
executes
.B /usr/lib/lpd
with each file as input.
.B Lpd
puts the file in
.B /usr/spool/lpd
and starts printing the jobs on
.B /dev/lp
unless another
.B lpd
is already running. If
.B lpd
finds any character in the input that it doesn't know how to handle then it
will print the rest of the file without any special treatment. This also
means that no formfeed is sent after the file has been printed to force out
the page.
.B Lpd
simply assumes that you know what you are doing. (dumb, eh?)
.PP
Note: Don't do anything with a file until it is printed,
.B lpd
only makes a copy of a file in the spool directory when it is not world
readable. If it can be read then it is printed directly.
.SH FILES
.TP 20
.BI /usr/spool/lpd/job XXXXX
Information about a job.
.TP
.BI /usr/spool/lpd/tmp XXXXX
Associated file to be printed.
.TP
.B /etc/termcap
The 'lp' entry describes the printer by the "li#" and "co#" fields. By
default 66 lines (li#66), and 80 columns (co#80).
.SH "SEE ALSO"
.BR lp (4),
.BR termcap (5),
.BR termcap (7).
.SH BUGS
Not spooling a world readable file may not be such a smart idea.
.PP
A formfeed should be printed and the printer reset after a job full of escape
codes, but this may cost paper.
.PP
No banner page.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

164
man/man1/ls.1 Normal file
View file

@ -0,0 +1,164 @@
.TH LS 1
.SH NAME
ls \- list the contents of a directory
.SH SYNOPSIS
\fBls\fP [\fB\-acdfghilpqrstu1ACDFLMRTX\fP] [\fIname\fP...]
.SH DESCRIPTION
For each file argument, list it. For each directory argument, list its
contents. The current working directory is listed when no files are named.
Information is printed multicolumn on terminals, single column if the output
is redirected. The options control what information is shown and how.
.PP
.B Ls
has two sources other then the command line to draw options from, one is
the environment variable
.B LSOPTS
that is scanned for option letters when the output of
.B ls
is displayed on a terminal. The other is the name of
.B ls
itself. If
.B ls
is linked to another name, then all the characters after the l are used as
flags too, except that d, f, r, t and x are translated to D, F, R, T and X.
Useful links are
.BR ll ,
.BR lf ,
.B lm
and
.BR lx .
.PP
Files whose names start with a dot are by default not listed.
.PP
Note that standard Minix doesn't have symbolic links or sockets and
.B \-u
and
.B \-c
are no-ops on a V1 file system, since only modified times are stored in V1
inodes.
.SH OPTIONS
.TP
.B \-a
All entries are listed, even
.B .
and
.B ..
.TP
.B \-c
Use inode changed time for sorting, listing or searching.
.TP
.B \-d
Do not list contents of directories, but list the directory itself.
.TP
.B \-f
Do not sort (should also be: treat a file as a directory, but that
can't be implemented portably).
.TP
.B \-g
Suppress the owner name on a long listing (implies
.BR \-l ).
.TP
.B \-h
Show file sizes in kilo, mega or gigabytes.
.TP
.B \-i
I-node number printed in the first column.
.TP
.B \-l
Long listing: mode, links, owner, group, size and time.
.RB ( "ls \-lC"
uses columns in a wide enough window!)
.TP
.B \-n
Print numerical user and group id's.
.TP
.B \-p
Mark directories with a '\fB/\fP'.
.TP
.B \-q
Print nongraphic characters as '\fB?\fP' (default on terminals).
.TP
.B \-r
Reverse the sort order.
.TP
.B \-s
Give the size in kilobytes in the first
.RB ( \-s )
or second column
.RB ( \-is ).
.TP
.B \-t
Sort by time (modified time default), latest first.
.TP
.B \-u
Use last accessed time for sorting, listing or searching.
.TP
.B \-1
Print in one column.
.TP
.B \-A
List all entries, but not
.B .
and
.B ..
(This is the default for privileged users.)
.TP
.B \-C
Print multicolumn (default on terminals).
.TP
.B \-D
Distinguish files by type, i.e. regular files together, directories
together, etc.
.TP
.B \-F
Mark directories with a '\fB/\fP', executables with a '\fB*\fP', \s-2UNIX\s+2
domain sockets with a '\fB=\fP', named pipes with a '\fB|\fP' and symbolic
links with a '\fB@\fP' behind the name.
.TP
.B \-L
Print the file referenced by a symbolic link instead of the link.
.TP
.B \-M
List mode before name (implies
.BR \-C ).
.TP
.B \-R
List directory trees recursively.
.TP
.B \-T
Print file times in a long format, e.g. "Oct 24 21:37:41 1996".
.TP
.B \-X
Print crunched mode and size before name (implies
.BR \-C ).
Only the rwx permissions that its caller has on the file are shown, but they
are in upper case if the caller owns the file and has given the permission
to the callers group or other users. The size is listed in bytes (<= 5K),
or rounded up kilo, mega or gigabytes.
.SH "SEE ALSO"
.BR du (1),
.BR stat (1),
.BR stat (2).
.SH BUGS
Having to type
.B ls \-C
when viewing files through
.BR more (1).
.PP
Is only portable to systems with the same
.B st_mode
(see
.BR stat (2)).
.PP
The
.B LSOPTS
variable and the
.BR -D ,
.B -M
and
.B -X
flags are not found on other
.B ls
implementations. (They have their own nonstandard flags.)
.SH AUTHOR
Kees J. Bot <kjb@cs.vu.nl>

98
man/man1/mail.1 Normal file
View file

@ -0,0 +1,98 @@
.TH MAIL 1
.SH NAME
mail \- send and receive electronic mail
.SH SYNOPSIS
\fBmail\fR [\fB\-epqr\fR] [\fB\-f\fR \fIfile\fR]
.br
\fBmail\fR [\fB\-dtv\fR] [\fB\-s\fR \fIsubject\fR] \fIuser\fR [...]
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-e" "Exit with status TRUE or FALSE to indicate if there is mail in mailbox"
.FL "\-p" "Print all mail and then exit"
.FL "\-q" "Quit program if SIGINT received"
.FL "\-r" "Reverse print order, i.e., print oldest first"
.FL "\-f" "Use \fIfile\fR instead of \fI/usr/spool/mail/user\fR as mailbox"
.PP
.FL "\-d" "Force use of the shell variable \fIMAILER\fR"
.FL "\-t" "Show distribution list as Dist: header in message"
.FL "\-v" "Verbose mode (passed on to \fIMAILER\fR)"
.FL "\-s" "Use Subject: \fIsubject\fR"
.SH EXAMPLES
.EX "mail ast" "Send a message to \fIast\fR"
.EX "mail" "Read your mail"
.EX "cat mail.cdiff | mail -s ''Here's the diff!'' asw " "Pipe program output to mail with a subject line"
.EX "mail -f /usr/spool/mail/asw" "How root can read asw's mail"
.SH DESCRIPTION
.PP
\fIMail\fR is an extremely simple electronic mail program. It can be used
to send or receive email on a single
\s-2MINIX\s+2
system, in which case it functions
as user agent and local delivery agent.
If the flag \fIMAILER\fR is defined in \fImail.c\fR,
it can also call a trans\%port agent to handle remote mail as well.
No such agent is supplied with
\s-2MINIX\s+2.
.PP
When called by \fIuser\fR with no arguments, it examines the mailbox
\fI/usr/spool/mail/user\fR, prints one message (depending on the \fB\-r\fR
flag), and waits for one of the following commands:
.PP
.nf
.ta 0.25i 1.25i
<newline> Go to the next message
\- Print the previous message
!command Fork off a shell and execute \fIcommand\fR
CTRL-D Update the mailbox and quit (same as q)
d Delete the current message and go to the next one
q Update the mailbox and quit (same as CTRL-D)
p Print the current message again
s [\fIfile\fR] Save message in the named file
x Exit without updating the mailbox
.PP
.PP
To send mail, the program is called with the name of one or more recipients as
arguments. The mail is sent, along with a postmark line containing the date.
For local delivery, a file named after each recipient in the directory
\fI/usr/spool/mail\fR must be writable. If a spool file does not exist for
a recipient it will be created.
.PP
If the directory \fI/usr/spool/mail\fR does not exist then the mail is
dumped on the console, so that system programs have a way to notify
a user on a system that does not have a mail spool.
.PP
The received mail contains a To: header showing the recipient. If there
are multiple recipients and the \fB\-t\fR option is specified each recipient
will also see a Dist: header line showing the other recipients.
.PP
The \fB\-s\fR option allows a subject to be specified. The subject must be
quoted if it contains spaces. If no subject is specified the mail
will be delivered with Subject: No subject.
.SH NOTES
The \fB\-s\fR option was added to make this simple mail program
consistent with mail programs found in other *nix variants. Many
programs, including the version of cron distributed with Minix releases
2.0.3 and later, report their outcome by piping output to the mail
program in order to send a mail message to root in lieu of writing a
log file. Such programs often expect the mail program to accept a
subject line using this option.
.SH BUGS
If an external \fIMAILER\fR is used it is likely the conditional code
supporting this will need some editing to be made to work correctly.
.SH AUTHOR
The original mail program for Minix was written by Peter B. Housel.
The -e and -t options were added by C. W. Rose. The -s option was added
by A. S. Woodhull. This man page revised by ASW 2003-07-18.

76
man/man1/make.1 Normal file
View file

@ -0,0 +1,76 @@
.TH MAKE 1
.SH NAME
make \- a program for maintaining large programs
.SH SYNOPSIS
\fBmake\fR [\fB\-f \fIfile\fR]\fR [\fB\-adeiknpqrst\fR] [\fIoption\fR] ... [\fItarget\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-f" "Use \fIfile\fP as the makefile"
.FL "\-d" "Print debugging information"
.FL "\-e" "Environment overrides makefile macros"
.FL "\-i" "Ignore status returned by commands"
.FL "\-k" "On error, skip to next command"
.FL "\-n" "Report, but do not execute"
.FL "\-p" "Print macros and targets"
.FL "\-q" "Question up-to-dateness of target"
.FL "\-r" "Rule inhibit; do not use default rules"
.FL "\-s" "Silent mode"
.FL "\-t" "Touch files instead of making them"
.SH EXAMPLES
.EX "make kernel" "Make \fIkernel\fP up to date"
.EX "make \-n \-f mfile" "Tell what needs to be done"
.SH DESCRIPTION
.PP
.I Make
is a program that is normally used for developing large programs consisting of
multiple files.
It keeps track of which object files depend on which source and header files.
When called, it does the minimum amount of recompilation to bring the target
file up to date.
.PP
The file dependencies are expected in
.I makefile
or
.I Makefile ,
unless another file is specified with \fB\-f\fR.
.I Make
has some default rules built in, for example, it knows how to make
.I .o
files
from
.I .c
files.
Here is a sample
.I makefile .
.PP
.nf
.ta +0.2i +\w'program:'u+1m +\w'cc \-o program head.o tail.o'u+2m
d=/user/ast # \fId\fP is a macro
program: head.o tail.o # \fIprogram\fR depends on these
cc \-o program head.o tail.o # tells how to make \fIprogram\fP
echo Program done. # announce completion
head.o: $d/def.h head.c # \fIhead.o\fP depends on these
.br
tail.o: $d/var.h tail.c # \fItail.o\fP depends on these
.PP
.fi
A complete description of \fImake\fR would require too much space here.
Many books on
\s-2UNIX\s+2
discuss
.I make .
Study the numerous \fIMakefiles\fR in the
\s-2MINIX\s+2
source tree for examples.
.SH "SEE ALSO"
.BR cc (1).

27
man/man1/makewhatis.1 Normal file
View file

@ -0,0 +1,27 @@
.TH MAKEWHATIS 1
.SH NAME
makewhatis \- build the whatis(5) database
.SH SYNOPSIS
.B makewhatis
.I directory
.SH DESCRIPTION
.B Makewhatis
makes the
.BR whatis (5)
database in the given manual page directory. This database is used by
.BR man (1)
to map titles to manual page names and by
.BR whatis (1)
to give one line descriptions. See
.BR whatis (5)
for a desciption of what a whatis database should look like and the
restrictions that are placed on the NAME sections so that
.B makewhatis
can make whatis lines out of the manual pages.
.SH "SEE ALSO"
.BR whatis (5).
.SH BUGS
Removing only font and size changes from the NAME section is often not
enough.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

201
man/man1/man.1 Normal file
View file

@ -0,0 +1,201 @@
.TH MAN 1
.SH NAME
man \- display online manual pages
.SH SYNOPSIS
.B man
.RB [ \-antkfq ]
.RB [ \-M
.IR path ]
.RB [ \-s
.IR section ]
.IR title " ..."
.SH DESCRIPTION
.B Man
displays the online manual pages for the specified titles in the specified
sections. The sections are as follows:
.PP
.TP
.B 1
User Commands
.br
Generic commands such as
.BR ls ,
.BR cp ,
.BR grep .
.TP
.B 2
System Calls
.br
Low level routines that directly interface with the kernel.
.TP
.B 3
Library Routines
.br
Higher level C language subroutines.
.TP
.B 4
Device Files
.br
Describes devices in
.BR /dev .
.TP
.B 5
File Formats
.br
Formats of files handled by various utilities and subroutines.
.TP
.B 6
Games
.br
It's not \s-2UNIX\s+2 without an adventure game.
.TP
.B 7
Miscellaneous
.br
Macro packages, miscellaneous tidbits.
.TP
.B 8
System Utilities
.br
Commands for the System Administrator.
.TP
.B 9
Documents
.br
Larger manuals explaining some commands in more detail.
.PP
(If you are new to Minix then try
.BR "man hier" ,
it will show you around the file system and give you many pointers to other
manual pages.)
.PP
By default,
.B man
will try the following files in a manual page directory for the command
.BR "man \-s 1 ls" :
.PP
.RS
.ft B
.nf
cat1/ls.1
cat1/ls.1.Z
man1/ls.1
man1/ls.1.Z
.fi
.ft P
.RE
.PP
Files in the man[1\-8] directories are formatted with
.BR "nroff \-man" .
Those in man9 are formatted with
.BR "nroff \-mnx" .
Files in the cat? directories are preformatted. Files with names ending in
.B .Z
are decompressed first with
.B zcat
(see
.BR compress (1)).
The end result is presented to the user using a pager if displaying on
the screen.
.PP
For each manual page directory in its search path,
.B man
will first try all the subdirectories of the manual page directory for
the files above, and then the directory itself. The directory
.B /usr/man
contains the standard manual pages, with manual pages for optional
packages installed in a subdirectory of /usr/man, with the same
structure as /usr/man. The directory
.B /usr/local/man
contains manual pages for locally added software. By default
/usr/local/man is searched first, then /usr/man.
.PP
A title is not simply used as a filename, because several titles may
refer to the same manual page. Each manual page directory contains a
database of titles in the
.BR whatis (5)
file that is created by
.BR makewhatis (1)
from the NAME sections of all the manual pages. A title is searched in
this database and the first title on a whatis line is used as a filename.
.SH OPTIONS
The options may be interspersed with the titles to search, and take effect
for the titles after them.
.TP
.B \-a
Show all the manual pages or one line descriptions with the given title in
all the specified sections in all the manual directories in the search path.
Normally only the first page found is shown.
.TP
.B \-n
Use
.B nroff \-man
to format manual pages (default).
.TP
.B \-t
Use
.B troff \-man
to format manual pages.
.TP
.B \-f
Use
.BR whatis (1)
to show a one line description of the title from the
.BR whatis (5)
file.
.TP
.B \-k
Use
.BR apropos (1)
to show all the one line descriptions of the title anywhere in the
.BR whatis (5)
files (implies
.BR \-a ).
.TP
.B \-q
Quietly check if all requested manual pages exist. No output, no errors,
just an exit code.
.TP
.BI \-M " path"
Use
.I path
as the search path for manual directories.
.TP
.BI \-s " section"
.I Section
is the section number the page is to be found in, or a comma separated
list of sections to use. Normally all sections are searched. The
search is always in numerical order no matter what your section list looks
like. A single digit is treated as a section number without the
.B \-s
for compatibility with BSD-style
.B man
commands.
.SH ENVIRONMENT
.TP 15n
.B MANPATH
This is a colon separated list of directories to search for manual
pages, by default
.BR /usr/local/man:/usr/man .
.TP
.B PAGER
The program to use to display the manual page or one line descriptions on
the screen page by page. By default
.BR more .
.SH FILES
.TP 25n
/usr/man/whatis
One of the
.BR whatis (5)
databases.
.SH "SEE ALSO"
.BR nroff (1),
.BR troff (1),
.BR more (1),
.BR whatis (1),
.BR makewhatis (1),
.BR catman (1),
.BR whatis (5),
.BR man (7).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

38
man/man1/mesg.1 Normal file
View file

@ -0,0 +1,38 @@
.\" @(#)mesg.1 6.1 (Berkeley) 4/29/85
.\"
.TH MESG 1 "April 29, 1985"
.AT 3
.SH NAME
mesg \- permit or deny messages
.SH SYNOPSIS
.B mesg
[
.B n
] [
.B y
]
.SH DESCRIPTION
.B Mesg
with argument
.B n
forbids messages via
.B write
and
.BR talk (1)
by revoking non-user
write permission on the user's terminal.
.B Mesg
with argument
.B y
reinstates permission.
All by itself,
.B mesg
reports the current state without changing it.
.SH FILES
/dev/tty*
.SH "SEE ALSO"
.BR write (1),
.BR talk (1).
.SH DIAGNOSTICS
Exit status is 0 if messages are receivable,
1 if not, 2 on error.

24
man/man1/mixer.1 Normal file
View file

@ -0,0 +1,24 @@
.TH MIXER 1
.SH NAME
mixer \- manipulate mixer settings on a sound card
.SH SYNOPSIS
\fBmixer\fP [\-\fBr\fP]
.SH DESCRIPTION
\fBMixer\fP, invoked without arguments, turns the screen into a sound mixer.
Levels can be changed with the cursor-left and cursor-right keys. Input and
output settings can be toggled with the space bar. For every sound source
there are two, or one when mono, sliders.
The input controls have only effect when recording with the Dac. These
settings can also be used to switch the left and right channels or, when
both channels are enabled on both Dac channels, record in mono.
To exit the mixer use the 'e' key.
Mixer settings can be stored and restored with the 's' (store) and 'r' keys.
When the store function is used \fBMixer\fP will write the settings to a file
in the user's home directory called \fI\.mixer\fP. The restore function reads
this file to restore saved settings.
.SH OPTIONS
.IP \-r
restore settings saved in \fI\.mixer\fP and exit immediately
.SH AUTHOR
Michel R. Prevenier (mrpreve@cs.vu.nl)

33
man/man1/mkdir.1 Normal file
View file

@ -0,0 +1,33 @@
.TH MKDIR 1
.SH NAME
mkdir \- make a directory
.SH SYNOPSIS
\fBmkdir [\fB\-p\fR] [\fB\-m \fImode\fR] \fIdirectory ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-m" "Create directory with mode"
.FL "\-p" "Create missing intermediate directories"
.SH EXAMPLES
.EX "mkdir dir" "Create \fIdir\fP in the current directory"
.EX "mkdir \-p /user/ast/dir" "Create the \fI/user/ast\fP and \fI/user/ast/dir\fP"
.SH DESCRIPTION
.PP
The specified directory or directories are created and initialized. If any
intermediate directory is missing and \fB\-p\fR is specified, the missing
component will be created and no error displayed if directory already
exists. If the \fB\-m\fR flag is used, this will be equivalent to a chmod
on the directory after its creation.
.SH "SEE ALSO"
.BR chmod (1),
.BR rmdir (1),
.BR mkdir (2).

30
man/man1/mkfifo.1 Normal file
View file

@ -0,0 +1,30 @@
.TH MKFIFO 1
.SH NAME
mkfifo \- make a named pipe
.SH SYNOPSIS
\fBmkfifo [\fB\-m \fImode\fR] \fIfifo ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-m" "Create fifo with specified mode"
.SH EXAMPLES
.EX "mkfifo pipe" "Create \fIpipe\fP in the current directory"
.EX "mkfifo -m a+w systatus" "Create the \fIsystatus\fP writable by all"
.SH DESCRIPTION
.PP
The specified fifo special files are created.
If the \fB\-m\fR flag is used, this will be equivalent to a chmod
on the fifo special file after its creation.
.SH "SEE ALSO"
.BR chmod (1),
.BR mknod (2),
.BR mknod (8).

88
man/man1/mkfs.1 Normal file
View file

@ -0,0 +1,88 @@
.TH MKFS 1
.SH NAME
mkfs \- make a file system
.SH SYNOPSIS
\fBmkfs \fR[\fB\-Ldot\fR] [\fB\-B \fIblocksize\fR] [\fB\-i \fIinodes\fR] [\fB\-b \fIblocks\fR] \fIspecial \fIprototype\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-L" "Make a listing on standard output"
.FL "\-d" "Use mod time of \fImkfs\fR binary for all files"
.FL "\-o" "Use a drive other than 0 or 1 (safety precaution)"
.FL "\-t" "Do not test if file system fits on the medium"
.FL "\-1" "Make a version 1 file system (for backward compatibility)"
.FL "\-i" "Number of i-nodes (files)"
.FL "\-B" "Filesystem block size (in bytes)"
.FL "\-b" "Filesystem size (in blocks)"
.SH EXAMPLES
.EX "mkfs /dev/fd1 proto" "Make a file system on \fI/dev/fd1\fR"
.EX "mkfs -b 360 /dev/fd1" "Make empty 360 block file system"
.EX "mkfs /dev/fd1 360" "Alternate way to specify the size"
.SH DESCRIPTION
.PP
.I Mkfs
builds a file system and copies specified files to it.
The prototype file tells which directories and files to copy to it.
If the prototype file cannot be opened, and its name is just a string of
digits, an empty file system will be made with the specified number of
blocks.
A sample prototype file follows.
The text following the \fI#\fR sign in the example below is comment.
In real prototype files, comments are not allowed.
.PP
.nf
.ta 0.20i 0.70i 1.10i 3i 3.5i 4i
boot # boot block file (ignored)
360 63 # blocks and i-nodes
d--755 1 1 # root directory
bin d--755 \|2 1 # bin dir: mode (755), uid (2), gid (1)
sh \|---755 2 1 /user/bin/shell # shell has mode \fIrwxr-xr-x\fP
mv -u-755 2 1 /user/bin/mv # u = SETUID bit
login -ug755 2 1 /user/bin/login # SETUID and SETGID
$ # end of \fI/bin\fP
dev d--755 2 1 # special files: tty (char), fd0 (block)
tty c--777 2 1 4 0 # uid=2, gid=1, major=4, minor=0
fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks
$ # end of \fI/dev\fP
user d--755 12 1 # user dir: mode (755), uid (12), gid (1)
ast d--755 12 1 # \fI/user/ast\fP
$ # \fI/user/ast\fP is empty
$ # end of \fI/user\fP
$ # end of root directory
.PP
.fi
The first entry on each line (except the first 3 and the $ lines, which
terminate directories) is the name the file or directory will get on the
new file system.
Next comes its mode, with the first character being
\fB\-dbc\fR for regular files, directories, block special files and character
special files, respectively.
The next two characters are used to specify the SETUID and SETGID bits, as
shown above.
The last three characters of the mode are the
.I rwx
protection bits.
.PP
Following the mode are the uid and gid.
For special files, the major and minor devices are needed.
.PP
The maximum size of a file system is 1 Gb for a version 2 file system,
and 64 Mb for a version 1 file system. Alas the 8086
.I fsck
runs out of memory on a V2 file system larger than 128 Mb, so for the 8086
version of
\s-2MINIX\s+2
you have to limit yourself to file systems of that size.
.SH "SEE ALSO"
.BR mkproto (1),
.BR fsck (1),
.BR mount (1).

36
man/man1/mkproto.1 Normal file
View file

@ -0,0 +1,36 @@
.TH MKPROTO 1
.SH NAME
mkproto \- create a MINIX prototype file
.SH SYNOPSIS
\fBmkproto \fR[\fB\-b \fIn\fR] [\fB\-d \fIstr\fR] [\fB\-g \fIn\fR] [\fB\-i \fIn\fR] [\fB\-p \fInnn\fR] [\fB\-s\fR] [\fB\-t \fIroot\fR] [\fB\-u \fIn\fR] \fIsource_directory\fR [\fIprototype_file\fR]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-b" "Number of blocks in the prototype is \fIn\fR"
.FL "\-d" "Indent the prototype file using \fIstr\fR instead of tab"
.FL "\-g" "Use \fIn\fR as the gid for all files and directories"
.FL "\-i" "Number of i-nodes in the prototype is \fIn\fR"
.FL "\-p" "Use \fInnn\fR (3 octal digits) as the protection mode"
.FL "\-s" "Use the same uid, gid and mode as the source files have"
.FL "\-t" "Use the string \fIroot\fR as the path prefix for every file"
.FL "\-u" "Use \fIn\fR as the uid for all files and directories"
.SH EXAMPLES
.EX "mkproto \-b360" "Make a 360K prototype of this directory"
.EX "mkproto \-u2 \-g1 \-p644" "Give all files uid 2, gid 1 and mode 644"
.SH DESCRIPTION
.PP
\fIMkproto\fR creates an \fImkfs\fR prototype file for the specified
source-directory.
The prototype file is either written to \fIstdout\fR or, if specified,
the proto-file.
.SH "SEE ALSO"
.BR mkfs (1).

39
man/man1/modem.1 Normal file
View file

@ -0,0 +1,39 @@
.TH MODEM 1
.SH NAME
modem \- switch the modem and getty state
.SH SYNOPSIS
\fBmodem \fR[\fB\-o\fR] [\fB\-i \fInum\fR] \fBtty\fIn\fR\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-o" "Turn getty off and set modem to dialout"
.FL "\-i" "Set line to dialin"
.SH EXAMPLES
.EX "modem \-o tty00" "Set tty00 to dialout"
.EX "modem \-i2 tty00" "Set tty00 to dialin (2 rings)"
.SH DESCRIPTION
.PP
The \fIgetty\fR program allows a terminal port to be used for both dialin and
dialout.
This little program switches the getty state, and also sends
some commands to the modem attached to the specified line.
If the \fB\-o\fR flag is presnt, \fImodem\fR will put the
getty process (if any) connected to the specified line into
SUSPEND state, which means that it
will not pay attention to that line until it is reset to RESTART state.
Also, \fImodem\fR will send some (Hayes)
commands to the attached modem to disable the auto-nanswer mode.
The \fB\-i\fR flag specifies the number of times the telephone has to
ring before the modem may answer the call (to give the operator a chance).
.SH "SEE ALSO"
.BR term (1),
.BR getty (8).

44
man/man1/mount.1 Normal file
View file

@ -0,0 +1,44 @@
.TH MOUNT 1
.SH NAME
mount \- mount a file system
.SH SYNOPSIS
\fBmount [\fB\-r\fR] \fIspecial \fIfile\fR
.br
\fBmount [\fB\-s\fR] \fIswapfile\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-r" "File system is mounted read-only"
.FL "\-s" "Mount swap space"
.SH EXAMPLES
.EX "mount /dev/fd1 /user" "Mount diskette 1 on \fI/user\fP"
.SH DESCRIPTION
.PP
The file system contained on the special file is mounted on \fIfile\fP.
In the example above, the root directory of the file system in drive 1
can be accessed as
.B /user
after the mount.
When the file system is no longer needed, it must be unmounted before being
removed from the drive.
.PP
With the
.B \-s
flag a device or file is mounted as swap space.
.SH "SEE ALSO"
.BR df (1),
.BR mkfs (1),
.BR fsck (1),
.BR mkswap (8),
.BR umount (1),
.BR mount (2),
.BR fstab (5).

109
man/man1/mt.1 Normal file
View file

@ -0,0 +1,109 @@
.TH MT 1
.SH NAME
mt \- magnetic tape control
.SH SYNOPSIS
.B mt
.RB [ \-f
.IR device ]
.RI [ count ]
.SH DESCRIPTION
.B Mt
is a user interface to the magnetic tape commands described in
.BR mtio (4).
It allows one to space a tape forwards or backwards, write end of file
markers, etc.
.PP
With the
.B \-f
option a tape device can be named, otherwise the environment variable
.B TAPE
is used if set. Standard input is used if the tape name is a dash (\-). The
.I count
argument is used to tell how many blocks or files to space or how many file
markers to write. It may be a C-style decimal, octal or hexadecimal constant,
by default "1".
.PP
.I Command
is the action to perform, it may be one of the following, or any
unambiguous prefix (like
.B st
for
.BR status ):
.TP 15
.B eof, weof
Write
.I count
end-of-file markers.
.TP
.B fsf
Forward space
.I count
file markers.
.TP
.B fsr
Forward space
.I count
records. (The size of a record depends on the tape, and may even be
variable, depending on the size of the writes.)
.TP
.B bsf
Backwards space
.I count
files. The count may be zero to backspace to the start of the current file.
(A tape device need not support backwards movement, or may be very slow
doing it. Rewinding and forward spacing may be better.)
.TP
.B bsr
Backwards space
.I count
records. The tape is positioned after the last block of the previous file
if you hit a filemark when spacing backwards. The block count is set to -1
to indicate that the driver has no idea where it is on the previous file.
.TP
.B eom
Forward space to the end of media.
.TP
.B rewind
Rewind the tape.
.TP
.B offline, rewoffl
Rewind and take offline. This may cause some drives to eject the tape.
.TP
.B status
Shows the status of the drive, the sense key of the last SCSI error,
current file number, current record number, residual count if the last
command that encountered end-of-file, and the current block size.
.TP
.B retension
Removes tape tension by winding and rewinding the tape completely.
.TP
.B erase
Erases the tape completely and rewinds it.
.TP
.B density
Sets the density code to read or write the tape to
.IR count .
Density codes supported depend on the drive. This command need not be
used if the drive senses the proper density on read and can only write
one density.
.TP
.B blksize, blocksize
Sets the block size used to read or write the tape to
.IR count .
This command may be used to select a fixed block size for a variable block
size tape. This will speed up I/O for small block sizes. Use a zero
.I count
to use variable sized blocks again.
.SH ENVIRONMENT
.TP 15n
.B TAPE
Tape drive to use if set.
.SH FILES
.TP 15n
.B /dev/nrst4
Default tape device.
.SH "SEE ALSO"
.BR mtio (4),
.BR st (4).
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

40
man/man1/nm.1 Normal file
View file

@ -0,0 +1,40 @@
.TH NM 1
.SH NAME
nm \- print name list
.SH SYNOPSIS
\fBnm\fR [\fB\-dgnopru\fR]\fR [\fIfile\fR] ...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-d" "Print the offsets in decimal instead of in hex"
.FL "\-g" "Print only external symbols"
.FL "\-n" "Sort numerically rather than alphabetically"
.FL "\-o" "Prepend file name to each line rather than only once"
.FL "\-p" "Do not sort, print in symbol-table order"
.FL "\-r" "Sort in reverse order"
.FL "\-u" "Print only undefined symbols"
.SH EXAMPLES
.EX "nm \-n a.out" "Print all symbols in numerical order"
.EX "nm \-dg a.out" "Print globals alphabetically in decimal"
.SH DESCRIPTION
.PP
\fINm\fR prints the symbol table of executable files when it is available.
If no file is given, the symbols in \fIa.out\fR are used.
The format of the table
is somewhat compatible with the one produced by \fIasld\fR when used with
the \fB\-s\fR option. The symbol table can be added with \fIast\fR.
Assembly language files do not have symbol tables.
.SH "SEE ALSO"
.BR anm (1),
.BR asize (1),
.BR ar (1),
.BR size (1).

38
man/man1/od.1 Normal file
View file

@ -0,0 +1,38 @@
.TH OD 1
.SH NAME
od \- octal dump
.SH SYNOPSIS
\fBod\fR [\fB\-bcdhox\fR]\fR [\fIfile\fR] [ [\fB+\fR] \fIoffset\fR [\fB.\fR][\fBb\fR]\fR ]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-b" "Dump bytes in octal"
.FL "\-c" "Dump bytes as ASCII characters"
.FL "\-d" "Dump words in decimal"
.FL "\-h" "Print addresses in hex (default is octal)"
.FL "\-o" "Dump words in octal (default)"
.FL "\-v" "Verbose (list duplicate lines)"
.FL "\-x" "Dump words in hex"
.SH EXAMPLES
.EX "od \-ox file" "Dump \fIfile\fP in octal and hex"
.EX "od \-d file +1000" "Dump \fIfile\fP starting at byte 01000"
.EX "od \-c file +10.b" "Dump \fIfile\fP starting at block 10"
.SH DESCRIPTION
.PP
.I Od
dumps a file in one or more formats.
If \fIfile\fP is missing, \fIstdin\fR is dumped.
The \fIoffset\fP argument tells
.I od
to skip a certain number of bytes or blocks before starting.
The offset is in octal bytes, unless it is followed by a
\&'.\&' for decimal or \fBb\fP for blocks or both.

44
man/man1/passwd.1 Normal file
View file

@ -0,0 +1,44 @@
.TH PASSWD 1
.SH NAME
passwd, chfn, chsh \- change a login password, full name or shell
.SH SYNOPSIS
\fBpasswd\fR [\fIuser\fR]\fR
.br
\fBchfn\fR [\fIuser\fR] \fIfullname\fR\fR
.br
\fBchsh\fR [\fIuser\fR] \fIshell\fR\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH EXAMPLES
.EX "passwd" "Change current user's password"
.EX "passwd ast" "Change ast's password (super\-user only)"
.EX "chsh /usr/bin/mail" "For those who only read mail"
.EX "chfn 'Jane Doe'" "Current user is Jane Doe"
.SH DESCRIPTION
.PP
.I Passwd
is used to change your password.
It prompts for the old and new passwords.
It asks for the new password twice, to reduce the effect of a typing error.
.I Chfn
changes the full name (GECOS field) in the password file.
.I Chsh
changes your login shell.
Do not forget to copy the modified password file back to the root file system,
or the changes will be lost when the system is rebooted.
.SH "SEE ALSO"
.BR login (1),
.BR su (1),
.BR crypt (3),
.BR getpwent (3),
.BR passwd (5),
.BR adduser (8).

40
man/man1/paste.1 Normal file
View file

@ -0,0 +1,40 @@
.TH PASTE 1
.SH NAME
paste \- paste multiple files together
.SH SYNOPSIS
\fBpaste\fR [\fB\-s\fR]\fR [\fB\-d\fI list\fR] \fIfile...\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.FL "\-d" "Set delimiter used to separate columns to \fIlist\fR.
.FL "\-s" "Print files sequentially, file \fIk\fR on line \fIk\fR.
.SH EXAMPLES
.EX "paste file1 file2" "Print \fIfile1\fR in col 1, \fIfile2\fR in col 2"
.EX "paste \-s f1 f2" "Print \fIf1\fR on line 1 and \fIf2\fR on line 2"
.EX "paste -d : file1 file2" "Print the lines separated by a colon"
.SH DESCRIPTION
.PP
\fIPaste\fR concatenates corresponding lines of the given input files
and writes them to standard output. The lines of the different files
are separated by the delimiters given with the option \-s\fR. If
no list is given, a tab is substituted for every linefeed, except the last one.
If end-of-file is hit on an input file, subsequent lines are empty.
Suppose a set of \fIk\fR files each has one word per line.
Then the \fIpaste\fR output will have \fIk\fR columns,
with the contents of file \fIj\fR in column \fIj\fR.
If the \fB\-s\fR flag is given, then the first
file is on line 1, the second file on line 2, etc.
In effect, \fB\-s\fR turns the output sideways.
.PP
If a list of delimiters is given, they are used in turn. The C escape
sequences \\n, \\t, \\\\, and \\0 are used for linefeed, tab, backslash, and
the null string, respectively.

555
man/man1/patch.1 Normal file
View file

@ -0,0 +1,555 @@
.\" -*- nroff -*-
.rn '' }`
'\" $Header$
'\"
'\" $Log$
'\" Revision 1.1 2005/05/02 13:01:39 beng
'\" Added man pages.
'\"
'\" Revision 2.0.1.2 88/06/22 20:47:18 lwall
'\" patch12: now avoids Bell System Logo
'\"
'\" Revision 2.0.1.1 88/06/03 15:12:51 lwall
'\" patch10: -B switch was contributed.
'\"
'\" Revision 2.0 86/09/17 15:39:09 lwall
'\" Baseline for netwide release.
'\"
'\" Revision 1.4 86/08/01 19:23:22 lwall
'\" Documented -v, -p, -F.
'\" Added notes to patch senders.
'\"
'\" Revision 1.3 85/03/26 15:11:06 lwall
'\" Frozen.
'\"
'\" Revision 1.2.1.4 85/03/12 16:14:27 lwall
'\" Documented -p.
'\"
'\" Revision 1.2.1.3 85/03/12 16:09:41 lwall
'\" Documented -D.
'\"
'\" Revision 1.2.1.2 84/12/05 11:06:55 lwall
'\" Added -l switch, and noted bistability bug.
'\"
'\" Revision 1.2.1.1 84/12/04 17:23:39 lwall
'\" Branch for sdcrdcf changes.
'\"
'\" Revision 1.2 84/12/04 17:22:02 lwall
'\" Baseline version.
'\"
.de Sh
.br
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
'\"
'\" Set up \*(-- to give an unbreakable dash;
'\" string Tr holds user defined translation string.
'\" Bell System Logo is used as a dummy character.
'\"
'\" Shut up a groff -ww warning.
'\".if \n(.g .if !dTr .ds Tr
'\".ie n \{\
.tr \(*W-\*(Tr
'\".ds -- \(*W-
'\".if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
'\".if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
.ds L' '
.ds R' '
'\"'br \}
'\".el \{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds L' `
.ds R' '
'\"'br\}
.TH PATCH 1 LOCAL
.SH NAME
patch - apply a diff file to an original
.SH SYNOPSIS
.B patch
[options] [origfile [patchfile]] [+ [options] [origfile]]...
.sp
but usually just
.sp
.B patch
<patchfile
.SH DESCRIPTION
.I Patch
will take a patch file containing any of the four forms of difference
listing produced by the
.I diff
program and apply those differences to an original file, producing a patched
version.
By default, the patched version is put in place of the original, with
the original file backed up to the same name with the
extension \*(L".orig\*(R" (\*(L"~\*(R" on systems that do not
support long filenames), or as specified by the
.BR -b ,
.BR -B ,
or
.B -V
switches.
The extension used for making backup files may also be specified in the
.B SIMPLE_BACKUP_SUFFIX
environment variable, which is overridden by above switches.
.PP
If the backup file already exists,
.B patch
creates a new backup file name by changing the first lowercase letter
in the last component of the file's name into uppercase. If there are
no more lowercase letters in the name, it removes the first character
from the name. It repeats this process until it comes up with a
backup file that does not already exist.
.PP
You may also specify where you want the output to go with a
.B -o
switch; if that file already exists, it is backed up first.
.PP
If
.I patchfile
is omitted, or is a hyphen, the patch will be read from standard input.
.PP
Upon startup, patch will attempt to determine the type of the diff listing,
unless over-ruled by a
.BR -c ,
.BR -e ,
.BR -n ,
or
.B -u
switch.
Context diffs (old-style, new-style, and unified) and
normal diffs are applied by the
.I patch
program itself, while ed diffs are simply fed to the
.I ed
editor via a pipe.
.PP
.I Patch
will try to skip any leading garbage, apply the diff,
and then skip any trailing garbage.
Thus you could feed an article or message containing a
diff listing to
.IR patch ,
and it should work.
If the entire diff is indented by a consistent amount,
this will be taken into account.
.PP
With context diffs, and to a lesser extent with normal diffs,
.I patch
can detect when the line numbers mentioned in the patch are incorrect,
and will attempt to find the correct place to apply each hunk of the patch.
As a first guess, it takes the line number mentioned for the hunk, plus or
minus any offset used in applying the previous hunk.
If that is not the correct place,
.I patch
will scan both forwards and backwards for a set of lines matching the context
given in the hunk.
First
.I patch
looks for a place where all lines of the context match.
If no such place is found, and it's a context diff, and the maximum fuzz factor
is set to 1 or more, then another scan takes place ignoring the first and last
line of context.
If that fails, and the maximum fuzz factor is set to 2 or more,
the first two and last two lines of context are ignored,
and another scan is made.
(The default maximum fuzz factor is 2.)
If
.I patch
cannot find a place to install that hunk of the patch, it will put the
hunk out to a reject file, which normally is the name of the output file
plus \*(L".rej\*(R" (\*(L"#\*(R" on systems that do not support
long filenames).
(Note that the rejected hunk will come out in context diff form whether the
input patch was a context diff or a normal diff.
If the input was a normal diff, many of the contexts will simply be null.)
The line numbers on the hunks in the reject file may be different than
in the patch file: they reflect the approximate location patch thinks the
failed hunks belong in the new file rather than the old one.
.PP
As each hunk is completed, you will be told whether the hunk succeeded or
failed, and which line (in the new file)
.I patch
thought the hunk should go on.
If this is different from the line number specified in the diff you will
be told the offset.
A single large offset MAY be an indication that a hunk was installed in the
wrong place.
You will also be told if a fuzz factor was used to make the match, in which
case you should also be slightly suspicious.
.PP
If no original file is specified on the command line,
.I patch
will try to figure out from the leading garbage what the name of the file
to edit is.
In the header of a context diff, the filename is found from lines beginning
with \*(L"***\*(R" or \*(L"---\*(R", with the shortest name of an existing
file winning.
Only context diffs have lines like that, but if there is an \*(L"Index:\*(R"
line in the leading garbage,
.I patch
will try to use the filename from that line.
The context diff header takes precedence over an Index line.
If no filename can be intuited from the leading garbage, you will be asked
for the name of the file to patch.
.PP
If the original file cannot be found or is read-only, but a suitable
SCCS or RCS file is handy,
.I patch
will attempt to get or check out the file.
.PP
Additionally, if the leading garbage contains a \*(L"Prereq: \*(R" line,
.I patch
will take the first word from the prerequisites line (normally a version
number) and check the input file to see if that word can be found.
If not,
.I patch
will ask for confirmation before proceeding.
.PP
The upshot of all this is that you should be able to say, while in a news
interface, the following:
.Sp
| patch -d /usr/src/local/blurfl
.Sp
and patch a file in the blurfl directory directly from the article containing
the patch.
.PP
If the patch file contains more than one patch,
.I patch
will try to apply each of them as if they came from separate patch files.
This means, among other things, that it is assumed that the name of the file
to patch must be determined for each diff listing,
and that the garbage before each diff listing will
be examined for interesting things such as filenames and revision level, as
mentioned previously.
You can give switches (and another original file name) for the second and
subsequent patches by separating the corresponding argument lists
by a \*(L'+\*(R'.
(The argument list for a second or subsequent patch may not specify a new
patch file, however.)
.PP
.I Patch
recognizes the following switches:
.TP 5
.B \-b
causes the next argument to be interpreted as the backup extension, to be
used in place of \*(L".orig\*(R" or \*(L"~\*(R".
.TP 5
.B \-B
causes the next argument to be interpreted as a prefix to the backup file
name. If this argument is specified any argument from -b will be ignored.
.TP 5
.B \-c
forces
.I patch
to interpret the patch file as a context diff.
.TP 5
.B \-d
causes
.I patch
to interpret the next argument as a directory, and cd to it before doing
anything else.
.TP 5
.B \-D
causes
.I patch
to use the "#ifdef...#endif" construct to mark changes.
The argument following will be used as the differentiating symbol.
Note that, unlike the C compiler, there must be a space between the
.B \-D
and the argument.
.TP 5
.B \-e
forces
.I patch
to interpret the patch file as an ed script.
.TP 5
.B \-E
causes
.I patch
to remove output files that are empty after the patches have been applied.
.TP 5
.B \-f
forces
.I patch
to assume that the user knows exactly what he or she is doing, and to not
ask any questions. It assumes the following: skip patches for which a
file to patch can't be found; patch files even though they have the
wrong version for the ``Prereq:'' line in the patch; and assume that
patches are not reversed even if they look like they are.
This option does not suppress commentary; use
.B \-s
for that.
.TP 5
.B \-t
similar to
.BR \-f ,
in that it suppresses questions, but makes some different assumptions:
skip patches for which a file to patch can't be found (the same as \fB\-f\fP);
skip patches for which the file has the wrong version for the ``Prereq:'' line
in the patch; and assume that patches are reversed if they look like
they are.
.TP 5
.B \-F<number>
sets the maximum fuzz factor.
This switch only applies to context diffs, and causes
.I patch
to ignore up to that many lines in looking for places to install a hunk.
Note that a larger fuzz factor increases the odds of a faulty patch.
The default fuzz factor is 2, and it may not be set to more than
the number of lines of context in the context diff, ordinarily 3.
.TP 5
.B \-l
causes the pattern matching to be done loosely, in case the tabs and
spaces have been munged in your input file.
Any sequence of whitespace in the pattern line will match any sequence
in the input file.
Normal characters must still match exactly.
Each line of the context must still match a line in the input file.
.TP 5
.B \-n
forces
.I patch
to interpret the patch file as a normal diff.
.TP 5
.B \-N
causes
.I patch
to ignore patches that it thinks are reversed or already applied.
See also
.B \-R .
.TP 5
.B \-o
causes the next argument to be interpreted as the output file name.
.TP 5
.B \-p<number>
sets the pathname strip count,
which controls how pathnames found in the patch file are treated, in case
the you keep your files in a different directory than the person who sent
out the patch.
The strip count specifies how many slashes are to be stripped from
the front of the pathname.
(Any intervening directory names also go away.)
For example, supposing the filename in the patch file was
.sp
/u/howard/src/blurfl/blurfl.c
.sp
setting
.B \-p
or
.B \-p0
gives the entire pathname unmodified,
.B \-p1
gives
.sp
u/howard/src/blurfl/blurfl.c
.sp
without the leading slash,
.B \-p4
gives
.sp
blurfl/blurfl.c
.sp
and not specifying
.B \-p
at all just gives you "blurfl.c", unless all of the directories in the
leading path (u/howard/src/blurfl) exist and that path is relative,
in which case you get the entire pathname unmodified.
Whatever you end up with is looked for either in the current directory,
or the directory specified by the
.B \-d
switch.
.TP 5
.B \-r
causes the next argument to be interpreted as the reject file name.
.TP 5
.B \-R
tells
.I patch
that this patch was created with the old and new files swapped.
(Yes, I'm afraid that does happen occasionally, human nature being what it
is.)
.I Patch
will attempt to swap each hunk around before applying it.
Rejects will come out in the swapped format.
The
.B \-R
switch will not work with ed diff scripts because there is too little
information to reconstruct the reverse operation.
.Sp
If the first hunk of a patch fails,
.I patch
will reverse the hunk to see if it can be applied that way.
If it can, you will be asked if you want to have the
.B \-R
switch set.
If it can't, the patch will continue to be applied normally.
(Note: this method cannot detect a reversed patch if it is a normal diff
and if the first command is an append (i.e. it should have been a delete)
since appends always succeed, due to the fact that a null context will match
anywhere.
Luckily, most patches add or change lines rather than delete them, so most
reversed normal diffs will begin with a delete, which will fail, triggering
the heuristic.)
.TP 5
.B \-s
makes
.I patch
do its work silently, unless an error occurs.
.TP 5
.B \-S
causes
.I patch
to ignore this patch from the patch file, but continue on looking
for the next patch in the file.
Thus
.sp
patch -S + -S + <patchfile
.sp
will ignore the first and second of three patches.
.TP 5
.B \-u
forces
.I patch
to interpret the patch file as a unified context diff (a unidiff).
.TP 5
.B \-v
causes
.I patch
to print out its revision header and patch level.
.TP 5
.B \-V
causes the next argument to be interpreted as a method for creating
backup file names. The type of backups made can also be given in the
.B VERSION_CONTROL
environment variable, which is overridden by this option.
The
.B -B
option overrides this option, causing the prefix to always be used for
making backup file names.
The value of the
.B VERSION_CONTROL
environment variable and the argument to the
.B -V
option are like the GNU
Emacs `version-control' variable; they also recognize synonyms that
are more descriptive. The valid values are (unique abbreviations are
accepted):
.RS
.TP
`t' or `numbered'
Always make numbered backups.
.TP
`nil' or `existing'
Make numbered backups of files that already
have them, simple backups of the others.
This is the default.
.TP
`never' or `simple'
Always make simple backups.
.RE
.TP 5
.B \-x<number>
sets internal debugging flags, and is of interest only to
.I patch
patchers.
.SH AUTHOR
Larry Wall <lwall@netlabs.com>
.br
with many other contributors.
.SH ENVIRONMENT
.TP
.B TMPDIR
Directory to put temporary files in; default is /tmp.
.TP
.B SIMPLE_BACKUP_SUFFIX
Extension to use for backup file names instead of \*(L".orig\*(R" or
\*(L"~\*(R".
.TP
.B VERSION_CONTROL
Selects when numbered backup files are made.
.SH FILES
$TMPDIR/patch*
.SH SEE ALSO
diff(1)
.SH NOTES FOR PATCH SENDERS
There are several things you should bear in mind if you are going to
be sending out patches.
First, you can save people a lot of grief by keeping a patchlevel.h file
which is patched to increment the patch level as the first diff in the
patch file you send out.
If you put a Prereq: line in with the patch, it won't let them apply
patches out of order without some warning.
Second, make sure you've specified the filenames right, either in a
context diff header, or with an Index: line.
If you are patching something in a subdirectory, be sure to tell the patch
user to specify a
.B \-p
switch as needed.
Third, you can create a file by sending out a diff that compares a
null file to the file you want to create.
This will only work if the file you want to create doesn't exist already in
the target directory.
Fourth, take care not to send out reversed patches, since it makes people wonder
whether they already applied the patch.
Fifth, while you may be able to get away with putting 582 diff listings into
one file, it is probably wiser to group related patches into separate files in
case something goes haywire.
.SH DIAGNOSTICS
Too many to list here, but generally indicative that
.I patch
couldn't parse your patch file.
.PP
The message \*(L"Hmm...\*(R" indicates that there is unprocessed text in
the patch file and that
.I patch
is attempting to intuit whether there is a patch in that text and, if so,
what kind of patch it is.
.PP
.I Patch
will exit with a non-zero status if any reject files were created.
When applying a set of patches in a loop it behooves you to check this
exit status so you don't apply a later patch to a partially patched file.
.SH CAVEATS
.I Patch
cannot tell if the line numbers are off in an ed script, and can only detect
bad line numbers in a normal diff when it finds a \*(L"change\*(R" or
a \*(L"delete\*(R" command.
A context diff using fuzz factor 3 may have the same problem.
Until a suitable interactive interface is added, you should probably do
a context diff in these cases to see if the changes made sense.
Of course, compiling without errors is a pretty good indication that the patch
worked, but not always.
.PP
.I Patch
usually produces the correct results, even when it has to do a lot of
guessing.
However, the results are guaranteed to be correct only when the patch is
applied to exactly the same version of the file that the patch was
generated from.
.SH BUGS
Could be smarter about partial matches, excessively \&deviant offsets and
swapped code, but that would take an extra pass.
.PP
If code has been duplicated (for instance with #ifdef OLDCODE ... #else ...
#endif),
.I patch
is incapable of patching both versions, and, if it works at all, will likely
patch the wrong one, and tell you that it succeeded to boot.
.PP
If you apply a patch you've already applied,
.I patch
will think it is a reversed patch, and offer to un-apply the patch.
This could be construed as a feature.
.rn }` ''

16
man/man1/playwave.1 Normal file
View file

@ -0,0 +1,16 @@
.TH PLAYWAVE 1
.SH NAME
playwave \- play an audio file in MicroSoft PCM wave format
.SH SYNOPSIS
\fBplaywave\fP [\-\fBi\fP] file
.SH DESCRIPTION
\fBPlaywave\fP writes the samples in a wave file to \fI/dev/audio\fP.
The wave file must be in Microsoft PCM format.
.SH OPTIONS
.IP \-i
display information about wave file
.SH BUGS
The highest sample rate that can be used depends on the speed of the system
and the size of the DMA buffer used in the driver. (/usr/src/kernel/sb16.h)
.SH AUTHOR
Michel R. Prevenier (mrpreve@cs.vu.nl)

Some files were not shown because too many files have changed in this diff Show more