Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vc(1) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

admin

delta

get

vc

PURPOSE

     Substitutes assigned values in place of keywords.

SYNOPSIS
     vc [-a] [-t] [-cchar] [-s] [keyword=value ... keyword=value]


DESCRIPTION

     The vc command is used  to control writing different ver-
     sions  of  a file  to  standard  output.  However,  since
     Source Code Control System commands ("admin,"  "get," and
     "delta")  provide more  efficient  and complete  control,
     they should be used instead of vc.

     The  vc  command  copies  lines from  standard  input  to
     standard output.   The flags and keywords  on the command
     line  and  control statements  in  the  input modify  the
     resulting  output.  vc  replaces  user declared  keywords
     with  their value  assigned on  the command  line.  These
     keywords  can be  replaced both  in text  and in  control
     statements.

       Control Statements

     A control  statement is  a single  line beginning  with a
     control character  (the default control character  is a :
     (colon)).   They provide  conditional  processing of  the
     input.  The allowable types of control statements are:

     :if condition

     text
     :end      Writes all the lines  between the :if statement
               and the  matching :end to standard  output only
               if condition  is true.   You can  nest :if-:end
               statements, but once a  condition is false, all
               remaining   nested   :if-:end  statements   are
               ignored.  See "Condition Syntax" for the syntax
               of conditions and allowable operators.
     :dcl  keyword  [, keyword  . . .  ]
               Declares  keywords.    All  keywords   must  be
               declared.
     :asg  keyword=value
               Assigns  value to  keyword.  An  :asg statement
               takes precedence over keyword assignment on the
               vc command line.  A  later :asg statement over-
               rides all earlier assignments of the associated

               keyword.  keywords  declared, but  not assigned
               values have null values.
     ::  text  Removes the two  leading control characters and
               replaces keywords  with their values,  and then
               copies the line to the standard output.
     :on
     :off      Turns  on or  off  keyword  replacement on  all
               lines.
     :ctl  char
               Changes the control character to char.
     :msg  message
               Writes a  message to  standard error  output in
               the form:

                 Message(n): message

               where n  is number of  the input line  on which
               the message appeared.
     :err message
               Writes an  error message  to standard  error in
               the form:

                 ERROR: message
                 ERROR: err statement on line n (vc15)

               vc stops  processing and returns an  exit value
               of 1.

       Condition Syntax

                              Item        Statements Allowed
                              condition   ::=or statement
                                          ::="not" or statement
                              or  state-  ::=and statement
                              ment
                                          ::=and statement | or statement
                              and state-  ::=expression
                              ment
                                          ::=expression "&" and statement
                              expression  ::="(" or statement ")"
                                          ::=value operator value

                              operator    ::="=" or "!=" or "<"  or ">"
                              value       ::=ASCII string
                                          ::=numeric string

     The available condition operators  and their meanings are
     as follows:

     =      equal
     !=     not equal
     &      and
     |      or
     >      greater than
     <      less than
     ( )    used for logical groupings
     not    may only occur immediately  after the if, and when
            present, inverts  the value  of the  entire condi-
            tion.

     The > and < (greater  than and less than symbols) operate
     only on unsigned integer values; for example: 012 > 12 is
     false.  All  other operators  take strings  as modifiers;
     for example: "012 != 12"  is true.  The precedence of the
     operators,  from  highest  to lowest  precedence,  is  as
     follows:

         "= != > <"  all of equal precedence

         "&"

         "|"

     Parentheses can be used, of course, to alter the order of
     precedence.

     Values must be separated from operators or parentheses by
     at least one blank or tab.

       Keyword Replacement

     A keyword must begin and  end with the same control char-
     acter used in control statements.  A keyword may be up to
     nine alphanumeric  characters, where the  first character
     must  be alphabetic.   Keyword  values can  be any  ASCII
     string.  A numeric keyword value is an unsigned string of
     digits.  values cannot contain tabs or spaces.

     Examples of keyword=value assignments are:

       numlines=4
       prog=acctg
       pass4=yes

     The  vc  command  removes   all  control  characters  and
     keywords from  input text  lines marked with  two control
     characters as it writes the  text to standard output.  To
     prevent  a  control  character  from  being  interpreted,
     precede it with a backslash, as in the following example:

       ::the :prog: program includes several of the following\:

     The keyword :prog:  is replaced by its value,  but the \:
     is passed to standard output as : (colon).

     Input lines beginning with a  \ (backslash) followed by a
     control character  are not control lines,  and are copied
     to  standard output  without  the  backslash.  vc  writes
     lines beginning with a backslash and no following control
     character  without  any  changes (including  the  initial
     backslash).

FLAGS

     -a      Replaces keywords  surrounded by  control charac-
             ters with their assigned  value in all text lines
             (not just those beginning  with two control char-
             acters).
     -cchar  Uses char as the control character.
     -s      Does  not display  the warning  messages normally
             displayed to standard error.
     -t      Ignores all  characters from  the beginning  of a
             line up to and  including the first tab character
             for detecting a control statement.  If vc finds a
             control character,  it ignores all  characters up
             to and including the tab.

RELATED INFORMATION

     The following commands:  "admin,"  "delta," and "get."

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026