SysIII/usr/src/man/man1/vc.1
.nr f 0
.bd S B 3
.de SP
.if n .ul
\%[\fB\-\\$1\fR\\c
.if n .ul 0
\\$2\\$3
..
.de SF
.if n .ul
\%[\fB\-\\$1\fR]
.if n .ul 0
..
.de ZZ
.hc ^
\fB^...\fR
.hc
..
.de AR
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 5
.TP 15
\fB\-\\$1\\fR
\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.nr f 1
..
.de C1
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 5
.TP 15
\\$1
\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.nr f 1
..
.de A1
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 5
.TP 15
\fB\-\\$1\fR[\fI\\$2\fR]
\\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.nr f 1
..
.de A2
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 5
.TP 15
\fB\-\\$1\fI\\$2\fR
\\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.nr f 1
..
.de FI
.PP
.TP 30
\\$1
\\$2
.i0
..
.de F1
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 13
.TP 7
\fB\\$1\fI\\$2\fR
\\$3
.nr f 1
..
.de F2
.if \\nf \{ \
. RE
. nr f 0 \}
.PP
.RS 13
.TP 7
\fB\\$1[\fI\\$2\fR]
\\$3
.nr f 1
..
.TH VC 1 Obsolescent
.SH NAME
vc \- version control
.SH SYNOPSIS
.B vc
.SF a
.SF t
.SP c char]
.SF s
[keyword=value ... keyword=value]
.SH DESCRIPTION
The
.I vc\^
command copies lines from the standard input to the
standard output under control of its
.I arguments\^
and
.I "control statements\^"
encountered in the standard input.
In the process of performing the copy operation, user declared
.I keywords\^
may be replaced by their string
.I value\^
when they appear in plain text and/or
control statements.
.PP
The copying of lines from the standard input to the standard output is
conditional, based on tests (in
control statements)
of keyword values specified in
control statements
or as
.I vc\^
command arguments.
.PP
A control statement is a single line
beginning with a control character, except as modified by the
.B \-t
keyletter (see below).
The default control character is colon (\fB:\fR), except as modified by the
.B \-c
keyletter (see below).
Input lines beginning with a backslash (\fB\\\fR) followed by a control character
are not control lines and
are copied to the standard output with the backslash removed.
Lines beginning with a backslash followed by a non-control character
are copied in their entirety.
.PP
A keyword
is composed of 9 or less alphanumerics;
the first must be alphabetic.
A value
is any \s-1ASCII\s0 string that can be created with
.IR ed (1);
a numeric value is an unsigned string of digits.
Keyword values may not contain blanks or tabs.
.PP
Replacement of keywords by values is done whenever a keyword
surrounded by control characters is encountered on a version control statement.
The
.B \-a
keyletter (see below)
forces replacement of keywords in
.I all\^
lines of text.
An uninterpreted control character may be included in a value by preceding
it with \fB\\\fR.
If a literal \fB\e\fR is desired, then it too must be preceded by \fB\e\fR.
.PP
.B "Keyletter arguments"
.AR a Forces
replacement of keywords surrounded by control characters with their assigned
value in
.I all\^
text lines and not just in
.I vc\^
statements.
.AR t All
characters from the beginning of a line up to and
including the first
.I tab\^
character are ignored for the purpose of detecting a
control statement.
If one is found, all characters up to and
including the
.I tab\^
are discarded.
.A2 c char Specifies
a control character to be used in place of \fB:\fR.
.AR s Silences
warning messages (not error) that are normally printed on the
diagnostic output.
.RE
.PP
.B "Version Control Statements"
.PP
.RE
.TP 5
\fB:\fRdcl keyword[, \fB...\fR, keyword]
.br
Used to declare keywords. All keywords must be declared.
.PP
.RE
.TP 5
\fB:\fRasg keyword=value
.br
Used to assign values to keywords. An
.B asg
statement overrides the assignment for the corresponding
keyword on the
.I vc\^
command line and all previous
.BR asg 's
for that keyword.
Keywords declared, but not assigned values have
null values.
.if \\n()s .bp
.PP
.nf
\fB:\fRif condition
.sp -.5v
\s+3.\s0
.sp -.5v
\s+3.\s0
.sp -.5v
\s+3.\s0
\fB:\fRend
.fi
.br
.RS 5
Used to skip lines of the standard input. If the condition is true
all lines between the
.I if\^
statement and
the matching
.I end\^
statement are
copied to the standard output.
If the condition is false, all intervening lines are discarded, including
control statements.
Note that intervening
.I if\^
statements and matching
.I end\^
statements are recognized solely for the purpose of
maintaining the proper
.I if-end\^
matching.
.br
.ne 9
The syntax of a condition is\fB:\fR
.nf
.sp
.in +1
.ta 8,17,25
<cond> \fB::\fR= [ "not" ] <or>
<or> \fB::\fR= <and> \(or <and> "\(or" <or>
<and> \fB::\fR= <exp> \(or <exp> "&" <and>
<exp> \fB::\fR= "(" <or> ")" \(or <value> <op> <value>
<op> \fB::\fR= "=" \(or "!=" \(or "<" \(or ">"
<value> \fB::\fR= <arbitrary \s-1ASCII\s0 string> \(or <numeric string>
.in -1
.fi
.sp
The available operators and their meanings are\fB:\fR
.sp
.in +3
.nf
.if n .ta 7
.if t .ta 8
= equal
!= not equal
& and
\(or or
> greater than
< less than
( ) used for logical groupings
not may only occur immediately after the \fIif\^\fP, and
when present, inverts the value of the
entire condition
.in -3
.fi
.sp
The \fB>\fR and \fB<\fR operate only on unsigned integer values
(e. g.\fB:\fR 012 > 12 is false).
All other operators take strings as arguments
(e. g.\fB:\fR 012 != 12 is true).
The precedence of the operators (from highest to lowest) is\fB:\fR
.in +3
.nf
= != > < all of equal precedence
&
\(or
.fi
.in -3
Parentheses may be used to alter the order of precedence.
.br
Values must be separated from operators or parentheses by at least one blank
or tab.
.RE
.TP 5
\fB::\fRtext
.br
Used for keyword replacement on lines that are copied to the standard output.
The two leading control characters are removed,
and keywords surrounded by control characters in text are replaced
by their value
before the line is copied to the
output file.
This action is independent of the
.B \-a
keyletter.
.PP
.RE
.TP 5
\fB:\fRon
.br
.RE
.TP 5
\fB:\fRoff
.br
Turn on or off keyword replacement on all lines.
.PP
.RE
.TP 5
\fB:\fRctl char
.br
Change the control character to char.
.PP
.in -10
.RE
.TP 5
\fB:\fRmsg message
.br
Prints the given message on the diagnostic output.
.PP
.RE
.TP 5
\fB:\fRerr message
.br
Prints the given message followed by\fB:\fR
.ti +5
\fB\s-1ERROR\s0\fR\fB:\fR err statement on line \fB...\fR (915)
.br
on the diagnostic output.
.I Vc\^
halts execution,
and returns an exit code of 1.
.PP
.i0
.SH DIAGNOSTICS
Use
.I help\c\^
(1)
for explanations.
.SH "EXIT CODES"
0 \- normal
.br
1 \- any error