.\" .\" CDDL HEADER START .\" .\" The contents of this file are subject to the terms of the .\" Common Development and Distribution License (the "License"). .\" You may not use this file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE .\" or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions .\" and limitations under the License. .\" .\" When distributing Covered Code, include this CDDL HEADER in each .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. .\" If applicable, add the following below this CDDL HEADER, with the .\" fields enclosed by brackets "[]" replaced with your own identifying .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" CDDL HEADER END .\" Copyright 1989 AT&T Copyright (c) 1990, Sun Microsystems, Inc. All Rights Reserved .\" .\" Portions Copyright (c) 2007 Gunnar Ritter, Freiburg i. Br., Germany .\" .\" Sccsid @(#)vc.1 1.10 (gritter) 3/25/07 .\" .\" from OpenSolaris vc 1 "5 Jul 1990" "SunOS 5.11" "User Commands" .TH VC 1 "3/25/07" "Heirloom Development Tools" "User Commands" .SH NAME vc \- version control .SH SYNOPSIS .HP .ad l .nh \fBvc\fR [\fB\-a\fR] [\fB\-t\fR] [\fB\-c\fR\ \fIchar\fR] [\fB\-s\fR] [\fIkeyword=value\fR...\ \fIkeyword=value\fR] .br .ad b .hy 1 .SH DESCRIPTION This command is obsolete and will be removed in the next release. .\" (not really) .PP The \fIvc\fR command copies lines from the standard input to the standard output under control of its arguments and of ``control statements'' encountered in the standard input. In the process of performing the copy operation, user-declared \fIkeyword\fRs may be replaced by their string \fIvalue\fR 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 \fIvc\fR command arguments. .PP A control statement is a single line beginning with a control character, except as modified by the \fB\-t\fR keyletter (see below). The default control character is colon (\fB:\fR), except as modified by the \fB\-c\fR keyletter (see below). Input lines beginning with a backslash (\fB\e\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 alphanumerics; the first must be alphabetic. A value is any \s-1ASCII\s+1 string that can be created with \fIed\fR; 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 \fB\-a\fR keyletter (see below) forces replacement of keywords in all lines of text. An uninterpreted control character may be included in a value by preceding it with \fB\e\fR\&. If a literal \fB\e\fR is desired, then it too must be preceded by \fB\e\fR\&. The following options are supported: .TP 14 \fB\-a\fR Forces replacement of keywords surrounded by control characters with their assigned value in all text lines and not just in \fIvc\fR statements. .TP \fB\-t\fR All characters from the beginning of a line up to and including the first tab character are ignored for the purpose of detecting a control statement. If a control statement is found, all characters up to and including the tab are discarded. .TP \fB\-c\fR\fIchar\fR Specifies a control character to be used in place of the ``\fB:\fR'' default. .TP \fB\-s\fR Silences warning messages (not error) that are normally printed on the diagnostic output. .PP \fIvc\fR recognizes the following version control statements: .TP 5 \fB:dcl \fR\fIkeyword\fR[\fB, \fR...\fB, \fR\fIkeyword\fR]\fR Declare keywords. All keywords must be declared. .TP \fB:asg \fR\fIkeyword\fR\fB=\fR\fIvalue\fR Assign values to keywords. An \fIasg\fR statement overrides the assignment for the corresponding keyword on the \fIvc\fR command line and all previous \fIasg\fR statements for that keyword. Keywords that are declared but are not assigned values have null values. .LP .PD 0 \fB:if\fR\fI condition\fR .IP \fB\&.\|.\|.\fR .TP \fB:end\fR .PD Skip lines of the standard input. If the condition is true, all lines between the \fIif\fR statement and the matching \fIend\fR statement are copied to the standard output. If the condition is false, all intervening lines are discarded, including control statements. Note: Intervening \fIif\fR statements and matching \fIend\fR statements are recognized solely for the purpose of maintaining the proper \fIif-end\fR matching. .sp The syntax of a condition is: .RS 12 .TP 10 .PD 0 \fB\fR ::= [ ``\fBnot\fR'' ] \fI\fR .TP \fB\fR ::= \fI | \fR``\fB|\fR'' \fI\fR .TP \fB\fR ::= \fI | \fR``\fB&\fR'' \fI\fR .TP \fB\fR ::= ``\fB(\fR'' \fI \fR``\fB)\fR'' \fI| \fR .TP \fB\fR ::= ``\fB=\fR'' \fI| \fR``\fB!=\fR'' \fI| ``\fR\fB<\fR'' | ``\fB>\fR''\fI\fR .TP \fB\fR ::= \fI | \fR .RE .PD .IP The available operators and their meanings are: .RS 12 .TP 10 .PD 0 \fB=\fR equal .TP \fB!=\fR not equal .TP \fB&\fR and .TP \fB|\fR or .TP \fB>\fR greater than .TP \fB<\fR less than .TP \fB()\fR used for logical groupings .TP \fBnot\fR may only occur immediately after the \fIif\fR, and when present, inverts the value of the entire condition .RE .PD .IP The \fB>\fR and \fB<\fR operate only on unsigned integer values (for example, \fB: 012 > 12\fR is false). All other operators take strings as arguments (for example, \fB: 012 != 12\fR is true). .IP The precedence of the operators (from highest to lowest) is: .RS 12 .TP 8 .PD 0 \fB= != > <\fR all of equal precedence .TP \fB&\fR \& .TP \fB|\fR \& .RE .PD .IP Parentheses may be used to alter the order of precedence. .IP Values must be separated from operators or parentheses by at least one blank or tab. .TP \fB::\fR\fItext\fR Replace keywords 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 \fB\-a\fR keyletter. .LP .PD 0 \fB:on\fR .TP .PD \fB:off\fR Turn on or off keyword replacement on all lines. .TP \fB:ctl\fR\fI char\fR Change the control character to \fIchar\fR. .TP \fB:msg\fR\fI message\fR Print \fImessage\fR on the diagnostic output. .TP \fB:err\fR\fI message\fR Print \fImessage\fR followed by: .sp \fB ERROR: err statement on line ... (915)\fR .sp on the diagnostic output. \fIvc\fR halts execution, and returns an exit code of \fB1\fR. .SH "ENVIRONMENT VARIABLES" .TP .BR LANG ", " LC_ALL See .IR locale (7). .TP .B LC_CTYPE Determines the mapping of bytes to characters for the control character. .SH SEE ALSO ed(1)