.\" extracted from etc/rc.sh 26 September 1996 by cmt2doc.pl
.TH RC 8 "26 September 1996" "FreeWare" "MAINTENANCE COMMANDS"
.PD .8v
.SH NAME
.nf
rc\&.sh \- run commands
.fi

.SH SYNOPSIS
.nf
\fBrc\fR\&.sh [\fB\-v\fR] [\fB\-n\fR] [\fB\-e\fR] [\fB\-d\fR \fIdir\fR] [\fB\-c\fR \fIclass\fR] [\fIargs\fR]
.fi

.SH DESCRIPTION

This is a generic rc script inspired by rc2 et al from SysV.

This script looks for all files that start with \fIclass\fR
in the directory \fIdir\fR (default is the script name without
\fB\&.sh\fR and with \fB\&.d\fR appended) and executes them. 

If the file name ends in \fB\&.sh\fR it is sourced into the
current process, otherwise it is run as a sub-shell with
\fIargs\fR as argument.

If \fIclass\fR is \fBS\fR then the default \fIargs\fR is \fBstart\fR.

If \fIclass\fR is \fBK\fR then the default \fIargs\fR is \fBstop\fR.

If \fIargs\fR contains any ``:'' characters then each word in
\fIargs\fR is assumed to be a \fIdir\fR:\fIclass\fR:\fIarg\fR tupple.

If neither \fIclass\fR nor \fIargs\fR are specified then the default
behaviour is as if \fIargs\fR were ``\fIdir\fR:K:stop \fIdir\fR:S:start''
which provides a reasonable imitation of rc\fIN\fR and is
generally quite useful.
.TP
Options:
.TP
\fB\-e\fR
Stop on error. Unlike its namesake in sh(1) we do not
exit if any command in any script fails, rather we
exit if one of the scripts (sourced or run) returns a
non-zero status.
.TP
\fB\-v\fR
Echo each script name as it is processed.
.TP
\fB\-n\fR
Do nothing, just show what would be done.
.TP
\fB\-d\fR \fIdir\fR
Process files in \fIdir\fR.
.TP
\fB\-c\fR \fIclass\fR
Process files in \fIdir\fR that start with \fIclass\fR.

.SH BUGS
.PP
We avoid use of anything but shell internals so that we can
run while the system is in single user mode and few
filesystems are mounted.  Because we do not use getopt(1), we
require a space between each option and between options and
their args. 

.SH AUTHOR

Simon J. Gerraty <sjg@zen\&.void\&.oz.au>

