sccs(CP)
sccs --
front end for the Source Code Control System (SCCS) subsystem
Syntax
sccs [-r] [-d prefixpath ] [-p sccspath]
command [options] [file ... ]
Description
The
sccs(CP)
command is a front end to various
commands in the Source
Code Control System (SCCS) subsystem, a tool to track changes in a file.
The database files, or SCCS files, are kept by default in a subdirectory
named ``SCCS'' in the current directory.
sccs prefixes the string "SCCS/s."
to its
file argument before it passes the
file argument to its command argument.
This prefix may be customized using
options -p and -d, or the environment variable
PROJECTDIR.
The command argument can be one of the
pseudo-commands or SCCS commands listed separately in the
``Pseudo-commands'' and ``SCCS commands'' subsections.
Options and option arguments
specific to the command being used must appear after
the command argument and are passed to
command by
sccs(CP).
Options to sccs itself
must appear before the command argument.
Options
sccs(CP)
supports three options, -r, -d, and -p.
-r-
Run command as the real user,
not as the effective user that sccs has been
set to through
setuid(S).
Not every user can run command through sccs
with setuid,
as this would allow anyone to change the file authorizations.
Those commands that are always run as the real user include
admin, check, clean,
diffs, info, rmdel, and tell.
-d prefixpath-
Use prefixpath, instead of the current directory,
as the root directory of the pathname
for the SCCS files.
If the environment variable PROJECTDIR is set, this option overrides
the value set in that environment variable. See also -p below.
-p sccspath-
Use sccspath, instead of SCCS, as
the pathname of the directory in which the SCCS files are kept.
Before sccs passes the
modified filename to its command argument,
it will insert
sccspath before the final
component of the argument file.
For example, when the command:
sccs -p sccspath get b/file
is used in the directory /a, sccspath will be
inserted before file and the command passed to the system
is converted to:
get /a/b/sccspath/s.file
Without the -p option, the command passed to the system is:
get /a/b/SCCS/s.file
The difference between the -d and -p options is that
prefixpath is prefixed to the entire pathname and
sccspath is inserted before the final component of
the pathname. If the sccs command is used with the
-d option in the directory
/a:
sccs -d /x get b/file
the pathname of the current directory /a
is replaced by the prefix /x and the command passed to the system is:
get /x/b/SCCS/s.file
The options -d and -p can also be used together as in:
sccs -d /x -p sccspath get b/file
The command passed to the system from this
sccs command is:
get /x/b/sccspath/s.file
Pseudo-commands
Several pseudo-commands are supported.
These pseudo-commands can be used as the command argument
to sccs.
Options for these pseudo-commands should be given in the
options argument to sccs, following command.
check-
If there is any file being checked
out for editing,
check returns a non-zero exit status and prints a listing
of files being edited. This is equivalent to info below.
It is different from info only when nothing is being edited:
check prints nothing and returns a zero exit status.
This can be an useful install entry in a makefile in order to make sure that
all changes are saved in the SCCS file before a version is installed.
clean-
Remove all files from the current directory that can be
reconstructed from SCCS files.
Normally, files checked out for editing are not removed even if no changes
have been made yet. However, branch deltas checked out for editing
will be removed if option -b is used.
Use this option carefully
if branches are also kept in the current directory, because changes
made to these branches since the last get will be lost.
create-
Create a new SCCS file in the SCCS directory for each named file.
Any valid option for admin
is valid for create.
The text from the
file file constitutes the first delta
of the SCCS file and the original file, file, will
be renamed by prefixing its basename with a comma (,).
Remove these renamed files after all SCCS files have been created
successfully. Note that no subsequent get is
performed on any SCCS files created.
delget-
For each named file, first perform a delta and then a get.
By default,
the get is not for editing and the
new version of the files will have their ID keywords expanded.
Options -m, -p, -r, -s and -y
given to delget will be passed to delta and
options -b, -c, -e, -i,
-k -l, -s and -x given to
delget will be passed to get.
deledit-
This is the same as delget, except that the get is for
editing by default (get -e).
deledit passes the same options to delta as
delget does; except for -e, deledit
passes all other options that delget passes to get
to edit,
another pseudo-command described below.
diffs-
Compare the current version of the file being edited
with the versions stored in the SCCS file.
Options that can be given to diffs and passed to get
are -r, -c, -i, -x and -t.
Other options are passed to
diff(C).
These include -e, -f -h and -b.
edit-
Check out a file for editing. This is the same as get -e.
fix -r SID-
Remove the named delta from the SCCS file and keep a copy
in the current directory.
The file kept has all the changes that were in the removed delta.
The -r option is required for fix.
No audit trail is left by fix. Use it carefully.
info-
Print a listing of all files being edited.
Use the option -b
to ignore branches in the listing.
In other words, if the option -b is used,
at most two components of SIDs are displayed in the listing.
Use the option -u user to display a listing of all files
being edited by the named user. The option -U
is the same as -u current_user.
print-
Print verbose information about the named files. print is the
same as prs passed to sccs.
tell-
Print a listing of all files being edited, one line per filename.
Options -b, -u and -U may be used as in
info and check.
For example, to examine the changes made to all files being edited:
sccs diffs `sccs tell -U`
or to delta all files being edited:
sccs delta `sccs tell -U`
unedit-
Discard any changes made to a file being edited
since the last edit command (or
get -e). No subsequent get is performed on the file.
SCCS Commands
The following SCCS commands can be passed
to the SCCS front end, sccs.
Options for these SCCS commands should be given in the
options argument to sccs, following command.
For descriptions of these options,
see the manual pages for each individual command.
Below is the usage summary of these SCCS commands.
admin-
Create new SCCS files or change parameters of existing SCCS
files. For creating new SCCS files, it is perhaps easier
to use sccs create.
Use sccs admin for other administrative tasks
on existing SCCS files.
delta-
Make a delta (change) to an SCCS file
retrieved for editing.
get-
Retrieve a version of an SCCS file.
When the option -e is used, the ID keywords in the file are not
expanded. The retrieved file may be edited and the changes made to the
file saved later by delta.
The sccs pseudo-commands sccs delget or
sccs deledit
combine the delta and get commands into one.
prs-
Print information about an SCCS file.
rmdel-
Remove a delta from an SCCS file.
The delta to be removed must not be the SID of the next delta
if the file is currently checked out for editing.
sact-
Print a summary of editing activity for named files. The information
includes the SID of the delta that currently exists in the SCCS file and
the SID of the next delta, the date and time when the command get -e
was executed, and the user who executed the command.
unget-
Discard changes made to a file that is checked out for editing.
val-
Validate parameters, such as SID and the %M% and %Y%
keywords, stored in SCCS files.
what-
Display identification information formed by
expanding the ID keyword %Z%.
Environment variables
Several environment variables may be used to change the default behavior
of sccs and provide a default value for prefixpath.
Additional environment variables may also
be used to change the default behavior of specific SCCS commands.
For descriptions of these additional environment variables,
see the manual pages for each individual command. Listed below
are environment variables used with sccs:
LANG-
Set the default value for
all internationalization variables (of the form LC_*) that
are either null or have not been set a value.
The default value for LANG is taken from the
system configured default locale,
and this default value is used if LANG is
null or has not been set.
See
locale(M)
for how to set a system default locale.
If any one of the internationalization variables has been set incorrectly,
sccs treats all these internationalization variables
as if they have not been set.
LC_ALL-
If LC_ALL has been set to a non-empty string,
it is the locale used for
all other internationalization variables even when
they are set.
LC_CTYPE-
Use this locale in mapping
sequences of bytes (in both arguments and input text files) to characters.
The mapping follows the
character classifications defined in the named locale.
LC_MESSAGES-
Use this locale for standard error messages.
The conventions are defined by the message catalogs
for this locale. Both the format and contents of diagnostic messages
may be affected by LC_MESSAGES.
NLSPATH-
A pathname template for message catalogs.
PROJECTDIR-
The default value for prefixpath. If
PROJECTDIR is an absolute pathname (starts with a slash),
it is used as prefixpath.
If it is a relative pathname, sccs will first
treat PROJECTDIR as a username and search in that user's
home directory for a subdirectory named src or source.
If such a subdirectory exists, the name of that directory will be used
by sccs as prefixpath. Otherwise, sccs
will use the value of PROJECTDIR for prefixpath.
For example, if a user johns has a src directory
under his home directory /u/johns:
/u/johns/src
and PROJECTDIR has been set to johns, the command:
sccs get prog.c
will be converted to:
get /u/johns/src/SCCS/s.prog.c
regardless of the directory in which the sccs command is issued.
Exit values
The sccs command returns an
exit value of 0 if no error occurred,
otherwise it returns a value greater than zero.
Diagnostics
See the description for the specified command.
Examples
-
This example shows how to put a file named
prog.c under SCCS control for the first time.
First create an SCCS subdirectory
if it does not exist, and then enter the file
into the SCCS database, as in:
mkdir SCCS
sccs create prog.c
After verifying that prog.c has been entered successfully,
remove the back up copy of the file whose name now starts with a comma:
rm ,prog.c
-
This example shows how to get a copy of prog.c
for editing, edit the file using the
vi(C)
editor, and then check it back into
the SCCS database, getting a read-only version of the file for later use:
sccs edit prog.c
vi prog.c
sccs delget prog.c
-
This example shows how to update a large number of SCCS database files which
all have the same change in this delta, and get a read-only copy for each of
the files:
sccs delget *.c < reason
The text file, reason, describes the change that has been made,
and provides delta with the comment text directly.
The user is not asked interactively for the delta comments
at the comments?
prompt in this example.
Files
/usr/bin/sccs-
See also
admin(CP),
chmod(C),
delta(CP),
get(CP),
locale(M),
make(CP),
prs(CP),
rmdel(CP),
sact(CP),
setuid(S),
unget(CP),
val(CP),
what(CP)
Standards conformance
sccs is conformant with:
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005