vc(1) CLIX vc(1)
NAME
vc - Provides basic version control
SYNOPSIS
vc [-a] [-t] [-cchar] [-s] [keyword=value ... ]
FLAGS
-a Forces replacement of keywords surrounded by control characters
with their assigned value in all text lines and not just in vc
statements.
-t Ignores all characters from the beginning of a line up to and
including the first <Tab> character, for the purpose of detecting
a control statement. If one is found, all characters up to and
including the <Tab> are discarded.
-cchar Specifies a control character to be used in place of the colon
(:).
-s Silences warning messages (not error messages) that are normally
displayed on the diagnostic output.
DESCRIPTION
The vc command copies lines from stdin to stdout under control of its
flags and control statements encountered in stdin. The copying of lines
from stdin to stdout is conditional, based on tests (in control
statements) of keyword values specified in control statements or as vc
command arguments. In the process of performing the copy operation, user
declared keywords may be replaced by their string value when they appear
in plain text and/or control statements.
A control statement is a single line beginning with a control character,
except as modified by the -t flag (see the FLAGS section). The default
control character is colon (:), except as modified by the -c flag (see the
FLAGS section). Input lines beginning with a backslash (\) followed by a
control character are not control lines and are copied to stdout with the
backslash removed. Lines beginning with a backslash followed by a
noncontrol character are copied in their entirety.
A keyword consists of nine or less alphanumeric characters. The first
character must be alphabetic. Keyword values may not contain blanks or
tabs. When keywords on the command line are encountered in a version
control statement in the input, they are replaced by their corresponding
value.
A value may be any ASCII string. A value replaces its corresponding
keyword in the output. A value is any ASCII string that can be created
2/94 - Intergraph Corporation 1
vc(1) CLIX vc(1)
with ed; a numeric value is an unsigned string of digits.
Replacement of keywords by values is done whenever a keyword surrounded by
control characters is encountered on a version control statement. The -a
flag (see the FLAGS section) forces replacement of keywords in all lines
of text. An uninterpreted control character may be included in a value by
preceding it with a backslash. If a literal backslash is desired, then it
too must be preceded by a backslash.
The following is list of Version Control Statements:
:dcl keyword[, keyword ... ]
Declares keywords. All keywords must be declared.
:asg keyword=value
Assigns values to keywords. An asg statement overrides the
assignment for the corresponding keyword on the vc command line and
all previous asg's for that keyword. Keywords declared but not
assigned values have null values.
:if condition
...
:end Skips lines of stdin. If the condition is true all lines between
the if statement and the matching end statement are copied to
stdout. If the condition is false, all intervening lines are
discarded, including control statements. Note that intervening if
statements and matching end statements are recognized solely for
the purpose of maintaining the proper if-end matching. The syntax
of a condition is:
cond ::= [not] or
or ::= and | and | or
and ::= exp | exp & and
exp ::= ( or ) | value op value
op ::= = | != | < | >
value ::= arbitrary ASCII string | numeric string
The following is a list of available operators along with their
meanings:
= equal
!= not equal
& and
| or
> greater than
< less than
2 Intergraph Corporation - 2/94
vc(1) CLIX vc(1)
( ) used for logical groupings
not may occur immediately after the if, and, when present, inverts
the value of the entire condition
The greater than (>) and less than (<) operators operate only on
unsigned integer values. For example, the following is false:
: 012 > 12
All other operators take strings as arguments. For example, the
following is true:
: 012 != 12
The precedence of the operators, from highest to lowest, is as
follows:
⊕ = != > < (all of equal precedence)
⊕ &
⊕ |
Parentheses may be used to alter the order of precedence. Values
must be separated from operators or parentheses by at least one
blank or tab.
::text Replaces keywords on lines copied to stdout. 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 -a
flag.
:on
:off Turns on or off keyword replacement on all lines.
:ctl char
Changes the control character to char.
:msg message
Displays the given message on the diagnostic output.
:err message
Displays the given message followed by:
ERROR: err statement on line ... (915)
on the diagnostic output. The vc command halts the execution and
returns an exit value of 1.
2/94 - Intergraph Corporation 3
vc(1) CLIX vc(1)
EXAMPLES
1. To display the file s.acc.h to stdout suppressing any vc warning
messages, enter:
vc -s <s.acc.h
2. To display the file s.date.c to the file mydate replacing all
occurrence of :date: with the string 12/15/90, enter:
vc -a date=12/15/90 <s,date,c > mydate
Note that the date keyword must be declared in the input files using
the :dcl statement. Thus the following line must appear in the file
s.date.c:
:dcl date
3. To display the file s.time.c to stdout replacing all occurrence of
!time! with the string 12:00, enter:
vc -a -s! time=12:00 <s.time.c
Note that the time keyword must be declared in the input files using
the :dcl statement. Thus the following line must appear in the file
s.time.c:
!dcl time
FILES
/usr/lib/help/vc
A help file for vc.
DIAGNOSTICS
The following is a list of diagnostic messages that can appear for the vc
command:
unknown command on line ...
The line given begins with a control character, but the command is
not a legal one.
... never used
The given keyword name was never used in any replacements. This is
only a warning.
... never declared
4 Intergraph Corporation - 2/94
vc(1) CLIX vc(1)
The given keyword name never occurred in a dcl statement. If you
did declare it check for typos. This is only a warning.
if with no matching end
There is a missing end statement or an extra if statement.
... declared twice on line ...
The named keyword has been redeclared on the indicated line.
out of space
A maximum of 40 keywords per invocation of vc are allowed. This
limit has been exceeded.
unmatched `:' on line ...
On the given line there is no control character to indicated the
end of the keyword name.
keyword name too long on line ...
On the indicated line a keyword name exceed nine characters.
invalid keyword name on line ...
On the indicated line, the keyword name does not start with an
alphabetic character or does not contain only alphanumeric
characters.
end without matching if on line ...
There is an extra end statement or a missing if statement.
parenthesis error on line ...
A left parenthesis occurred with no matching right parenthesis or a
parenthesis was found where it was not expected.
invalid operator on line ...
An unrecognized operator was found. The legal operators are !=, =,
<, and >.
non-numerical value on line ...
On the indicated line, an attempt was made to compare a string
which contains non-numeric characters with another string using the
< or > operator.
err statement on line ...
The user has put an err statement on the given line.
out of space [line ...]
The indicated line requires too many replacements. Currently, only
32 replacements per line are allowed.
syntax on line ...
The equal sign has been left out of an asg statement, or the right
side on an asg statement is missing.
2/94 - Intergraph Corporation 5
vc(1) CLIX vc(1)
syntax on line ...
The syntax for the if statement on the indicated line is incorrect.
An ampersand (&) or a vertical bar (|) occurred in the wrong place
or was not found when they were expected.
syntax on line ...
There is something strange about the indicated line.
... never assigned a value
The given keyword name was never used in an assignment statement.
This is only a warning.
EXIT VALUES
The vc command exits with 0 if successful or -1 if unsuccessful.
RELATED INFORMATION
Commands: ed(1), help(1)
6 Intergraph Corporation - 2/94