home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeBook TitleSearch this book

19.3. General RCS Specifications

This section discusses:

  • Keyword substitution

  • Keywords

  • Example values

  • Revision numbering

  • Specifying the date

  • Specifying states

  • Standard options and environment variables

19.3.2. Keywords

$Author: ellie $

Username of person who checked in the revision.

$Date: 2002/11/08 17:52:39 $

Date and time of check-in.

$Header: /work/online/cdtest/unix_3/unixnut/RCS/ch19_03.htm,v 1.2 2002/11/08 17:52:39 ellie Exp ellie $

A title that includes the RCS file's full pathname, revision number, date, author, state, and (if locked) the person who locked the file.

$Id: ch19_03.htm,v 1.2 2002/11/08 17:52:39 ellie Exp ellie $

Same as $Header: /work/online/cdtest/unix_3/unixnut/RCS/ch19_03.htm,v 1.2 2002/11/08 17:52:39 ellie Exp ellie $, but exclude the full pathname of the RCS file.

$Locker: ellie $

Username of person who locked the revision. If the file isn't locked, this value is empty.

$Log: ch19_03.htm,v $
Revision 1.2 2002/11/08 17:52:39 ellie
fixed entities
Revision 1.1 2002/11/04 21:32:21 ellie
Initial revision

The message that was typed during check-in to describe the file, preceded by the RCS filename, revision number, author, and date. Log messages accumulate rather than being overwritten.

RCS uses the “comment leader” of the $Log: ch19_03.htm,v $

RCS uses the “comment leader” of the Revision 1.2 2002/11/08 17:52:39 ellie

RCS uses the “comment leader” of the fixed entities

RCS uses the “comment leader” of the

RCS uses the “comment leader” of the Revision 1.1 2002/11/04 21:32:21 ellie

RCS uses the “comment leader” of the Initial revision

RCS uses the “comment leader” of the line for the log messages left in the file. The comment leader stored in the RCS file is useful only for exchanging files with older versions of RCS.

$Name: $

The symbolic name used to check in the revision, if any.

$RCSfile: ch19_03.htm,v $

The RCS filename, without its pathname.

$Revision: 1.2 $

The assigned revision number.

$Source: /work/online/cdtest/unix_3/unixnut/RCS/ch19_03.htm,v $

The RCS filename, including its pathname.

$State: Exp $

The state assigned by the -s option of ci or rcs.

19.3.3. Example Values

Let's assume that the file /projects/new/chapter3 has been checked in and out by a user named daniel. Here's what keyword substitution produces for each keyword, for the second revision of the file:

$Author: ellie $

$Date: 2002/11/08 17:52:39 $

$Header: /project/new/chapter3,v 1.2 92/03/18/ 17:51:36 daniel \
     Exp Locker: daniel $            

$Id: cahpter3,v 1.2 1992/03/18 17:51:36 daniel Exp Locker:
daniel $

$Locker: ellie $

$Log: ch19_03.htm,v $
Revision 1.2  2002/11/08 17:52:39  ellie
fixed entities

Revision 1.1  2002/11/04 21:32:21  ellie
Initial revision

# Revision 1.2  92/03/18  17:51:36  daniel
# Added section on error-handling
# Revision 1.1  92/03/18  16:49:59  daniel
# Initial revision

$Name:  $

$RCSfile: ch19_03.htm,v $

$Revision: 1.2 $

$Source: /work/online/cdtest/unix_3/unixnut/RCS/ch19_03.htm,v $

$State: Exp $

19.3.4. Revision Numbering

Unless told otherwise, RCS commands typically operate on the latest revision. Some commands have an -r option that specifies a revision number. In addition, many options accept a revision number as an optional argument. (In the command summary, this argument is shown as [R].) Revision numbers consist of up to four fields: release, level, branch, and sequence; but most revisions consist of only the release and level. For example, you can check out revision 1.4 as follows:

co -l -r1.4 ch01

When you check it in again, the new revision will be marked as 1.5. Now suppose the edited copy needs to be checked in as the next release. You would type:

ci -r2 ch01

This creates revision 2.1. You can also create a branch from an earlier revision. The following command creates revision

ci -r1.4.1 ch01

Numbers that begin with a period are considered to be relative to the default branch of the RCS file. Normally, this is the “trunk” of the revision tree.

Numbers are not the only way to specify revisions, though. You can assign a text label as a revision name, using the -n option of ci or rcs. You can also specify this name in any option that accepts a revision number for an argument. For example, you could check in each of your C files, using the same label regardless of the current revision number:

ci -u -nPrototype *.c

In addition, you may specify a $, which means the revision number extracted from the keywords of a working file. For example:

rcsdiff -r$ ch01

compares ch01 to the revision that is checked in. You can also combine names and symbols. The command:

rcs -nDraft:$ ch*

assigns a name to the revision numbers associated with several chapter files.

19.3.7. Standard Options and Environment Variables

RCS defines an environment variable, RCSINIT, which sets up default options for RCS commands. If you set RCSINIT to a space-separated list of options, they will be prepended to the command-line options you supply to any RCS command.

Six options are useful to include in RCSINIT: -q, -V, -Vn, -T, -x, and -z. They can be thought of as standard options because most RCS commands accept them.

Quiet mode; don't show diagnostic output. R specifies a file revision.

If the file with the new revision has a later modification time than that of the RCS file, update the RCS file's modification time. Otherwise, preserve the RCS file's modification time. This option should be used with care; see the discussion in the ci manpage for more detail.

Print the RCS version number.

Emulate version n of RCS; useful when trading files between systems that run different versions. n can be 3, 4, or 5.

Specify an alternate list of suffixes for RCS files. Each suffix is separated by a /. On Unix systems, RCS files normally end with the characters ,v. The -x option provides a workaround for systems that don't allow a comma character in filenames.

timezone controls the output format for dates in keyword substitution. timezone should have one of the following values:


Default format: UTC with no time zone and slashes separating the parts of the date.


The local time and date, in ISO-8601 format, with time-zone indication (YYYY-MM-DD HH:MM:SS-ZZ).


With a numeric offset from UTC, the output is in IS0-8601 format.

For example, when depositing a working file into an RCS file, the command:

ci -x,v/ ch01     Second suffix is blank

searches in order for the RCS filenames:


RCS allows you to specify a location for temporary files. It checks the environment variables TMPDIR, TMP, and TEMP, in that order. If none of those exist, it uses a default location, such as /tmp.

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.