Book HomeBook TitleSearch this book

18.6. Alphabetical Summary of SCCS Commands

File arguments to SCCS commands can be either filenames or directory names. Naming a directory processes all the files in that directory, with nonapplicable and unreadable files ignored. (Unreadable files produce an error message.) If in place of a file argument a dash (–) is entered, the command reads the names of files to process from standard input, one on each line.

Use the form yy[mm[dd[hh[mm[ss]]]]] for commands that accept times and dates. Values left out default to the highest valid value. Furthermore, Solaris treats years from 69 to 99 as being in the 20th century, while years between zero and 68 are in the 21st.

On Solaris, all SCCS commands reside in /usr/ccs/bin. To use these commands, be sure to add this directory to your PATH environment variable.

admin

admin [options] files

Add files to SCCS or change options of SCCS files.

Options

-a[user | groupid]
Assign user or groupid permission to make deltas; a ! before user or groupid denies permission. If no list is given, anyone has permission.

-b
Encode the file contents as binary data. Files that contain ASCII NUL or other control characters, or that do not end in a newline, are automatically treated as binary files and encoded. This option is typically used together with -i. Solaris only.

-dflag
Delete flag previously set with -f. Applicable flags are:

b

Enable the -b option in a get command; this allows branch deltas.

cn

Set highest release to n (default is 9999).

dn

Set get's default delta number to n.

fn

Set lowest release to n (default is 1).

i[string]

Treat “No id keywords (ge6)” as a fatal error. string, if present, forces a fatal error if keywords do not exactly match string. Solaris does not allow you to supply a string.

j

Allow multiple concurrent get s.

llist

Releases in list cannot accept changes; use the letter a to specify all releases.

mname

Substitute %M% keyword with module name.

n

Create a null delta from which to branch.

qstring

Substitute %Q% keyword with string.

ttype

Substitute %Y% keyword with module type.

v[prog]

Force delta command to prompt for modification request numbers as the reason for creating a delta. Run program prog to check for valid numbers.

-e[user | groupid]
Permission to make deltas is denied to each user or groupid.

-fflag
Set flag (see -d above).

-h
Check an existing SCCS file for possible corruption.

-i[file]
Create a new SCCS file using the contents of file as the initial delta. If file is omitted, use standard input. This option implies the -n option.

-m[list]
Insert list of modification request numbers as the reason for creating the file.

-n
Create a new SCCS file that is empty.

-rn.n
Set initial delta to release number n.n. Default is 1.1. Can only be used with -i.

-t[file]
Replace SCCS file description with contents of file. If file is missing, the existing description is deleted.

-y[text]
Insert text as comment for initial delta (valid only with -i or -n).

-z
Recompute the SCCS file checksum and store in first line. The file should be verified first; see val.

cdc

cdc -rsid [options] files

Change the delta comments of the specified sid (SCCS ID) of one or more SCCS files.

Options

-m[list]
Add the list of modification request numbers (use a ! before any number to delete it). -m is useful only when admin has set the v flag for file. If -m is omitted, the terminal displays MRs? as an input prompt.

-y[string]
Add string to the comments for the specified delta. If -y is omitted, the terminal displays comments? as an input prompt.

Example

For delta 1.3 of file s.prog.c, add modification numbers x01-5 and x02-8, and then add comments:

$ cdc -r1.3 s.prog.c 
MRs? x01-5 x02-8
comments? this went out to review
comb

comb [options] files

Reduce the size of the specified SCCS files. This is done by pruning selected deltas and combining those that remain, thereby reconstructing the SCCS file. The default behavior prunes all but the most recent delta in a particular branch and keeps only those ancestors needed to preserve the tree structure. comb produces a shell script on standard output. Actual reconstruction of the SCCS files is done by running the script.

Options

-clist
Preserve only those deltas whose SCCS IDs are specified in the comma-separated list. Use a hyphen (–) to supply a range; e.g., 1.3,2.1-2.5.

-o
Access the reconstructed file at the release number of the delta that is created, instead of at the most recent ancestor. This option may change the tree structure.

-psid
In reconstructing file, discard all deltas whose SCCS identification string is older than sid.

-s
Generate a shell script that calculates how much the file will be reduced in size. -s is useful as a preview of what comb does when actually run.

delta

delta [options] files

Incorporate changes (add a delta) to one or more SCCS files. delta stores changes made to a text file retrieved by get -e and then edited. delta normally removes the text file.

Options

-d
Use diff instead of bdiff to find the changes. Solaris only.

-glist
Ignore deltas whose SCCS IDs (version numbers) are specified in the comma-separated list. Use – to supply a range; e.g., 1.3,2.1-2.5.

-m[list]
Supply a list of modification request numbers as reasons for creating new deltas. -m is useful only when admin has set the v flag for file. If -m is omitted, the terminal displays MRs? as an input prompt.

-n
Do not remove the edited file (extracted by get -e) after execution of delta.

-p
Print a diff-style listing of delta changes to file.

-rSID
Delta version number that identifies file. -r is needed only when more than one version of an SCCS file is being edited simultaneously.

-s
Suppress printing of new SID and other delta information.

-y[string]
Insert string as a comment describing why the delta was made. If -y is omitted, the terminal displays comments? as an input prompt.

get

get [options] files

Retrieve a text version of an SCCS file. The retrieved text file (also called the g-file) has the same name as the SCCS file but drops the s. prefix. For each SCCS file, get prints its version number and the number of lines retrieved. See the previous section, “Identification Keywords”, for a list of keywords that can be placed in text files.

Options

-an
Retrieve delta sequence number n; not very useful (used by comb).

-b
Create new branch (use with -e).

-cdate
Retrieve a version that includes only those changes made before date. date is a series of two-digit numbers indicating the year, followed by an optional month, day, hour, minute, and second. Nonnumeric characters can be used as field separators; they are essentially ignored.

-e
Retrieve a text file for editing; this is the most commonly used option. Implies -k.

-g
Suppress the text and just retrieve the SCCS ID (version number), typically to check it.

-Gname
Save retrieved text in file name (default is to drop the s. prefix). Solaris only.

-ilist
Incorporate into the retrieved text file any deltas whose SCCS IDs (version numbers) are specified in the comma-separated list. Use a hyphen (–) to supply a range (e.g., 1.3,2.1-2.5).

-k
Do not expand ID keywords to their values; use in place of -e to regenerate (overwrite) a text file that was ruined during editing.

-l[p]
Create a delta summary (saved to a file or, with -lp, displayed on standard output).

-m
Precede each text line with the SCCS ID of the delta it relates to.

-n
Precede each text line with the %M% keyword (typically the name of the text file).

-p
Write retrieved text to standard output instead of to a file.

-r[sid]
Retrieve SCCS ID (version number) sid. With no sid, retrieve the latest version or the version specified by the d flag in the SCCS file.

-s
Suppress normal output (show error messages only).

-t
Retrieve the top (most recent) version of a release.

-wstring
Replace the %W% keyword with string; %W% is the header label used by what.

-xlist
Exclude the list of deltas from the retrieved text file; the inverse of -i.

Examples

Retrieve file prog.c for editing; a subsequent delta creates a branch at version 1.3:

get -e -b -r1.3 s.prog.c

Retrieve file prog.c; contents will exclude changes made after 2:30 p.m. on June 1, 1990 (except for deltas 2.6 and 2.7, which are included):

get -c'90/06/01 14:30:00' -i'2.6,2.7' s.prog.c

Display the contents of s.text.c (all revisions except 1.1 – 1.7):

get -p -x1.1-1.7 s.text.c
help

help [commands | error_codes]

Online help facility to explain SCCS commands or error messages. With no arguments, help prompts for a command name or an error code. To display a brief syntax, supply the SCCS command name. To display an explanation of an error message, supply the code that appears after an SCCS error message. The help files usually reside in /usr/ccs/lib.

Error messages produced by aborted SCCS commands are of the form:

ERROR filename: message (code)

The code is useful for finding out the nature of your error. To do this, type:

help code

Example

When everything else fails, try this:

help stuck
prs

prs [options] files

Print formatted information for one or more SCCS files.

Options

-a
Include information for all deltas, including removed ones.

-cdate
Cutoff date used with -e or -l (see get for format of date).

-d[format]
Specify output format by supplying text and/or SCCS keywords. See the previous section, “Data Keywords,” for a list of valid keywords. Use \t and \n in the format to create a tab and newline, respectively.

-e
With -r, list data for deltas earlier than or including sid; with -c, list data for deltas not newer than date.

-l
Like -e, but later than or including sid or date.

-r[sid]
Specify SCCS ID sid; default is the most recent delta.

Example

The following command:

prs -d"program :M: version :I: by :P:" -r s.yes.c

might produce this output:

program yes.c version 2.4.6 by daniel
prt

prt [options] files

Solaris only. Format and print the contents of one or more SCCS files. By default, prt prints the delta table (i.e., the version log). The sccsfile(4) manpage describes the contents of SCCS files in detail.

Options

-a
Display entries for all deltas, including removed ones.

-b
Print the body of the SCCS file.

-cdate
Exclude entries that are prior to date. Each entry is printed as a single line, preceded by the name of the file. This makes it possible to easily sort multiple version logs.

-d
Print delta table entries. This is the default action.

-e
Print everything. This option implies -d, -i, -f, -t, and -u.

-f
Print the flags for each SCCS file.

-i
Print the SIDs of included, excluded, and ignored deltas.

-rdate
Exclude deltas that are newer than date.

-s
Print only the first line (the statistics) of each delta table.

-t
Print the SCCS file's descriptive text.

-u
Print the usernames and/or numerical group IDs of users that are allowed to make changes.

-y[sid]
Exclude deltas that are older than sid. If no delta in the table matches sid, print the entire table. With no sid, print information for the current delta.

rmdel

rmdel -r sid files

Remove a delta from one or more SCCS files, where sid is the SCCS ID. The delta must be the most recent in its branch, and it cannot be checked out for editing.

sact

sact files

For the specified SCCS files, report which deltas are about to change (i.e., which files are currently being edited via get -e but haven't yet been updated via delta). sact lists output in five fields: SCCS ID of the current delta being edited, SCCS ID of the new delta to create, user who issued the get -e, and the date and time it was issued.

sccsdiff

sccsdiff -rsid1 -rsid2 [options] files

Report differences between two versions of an SCCS file. sid1 and sid2 identify the deltas to be compared. This command invokes bdiff, which in turn calls diff. Solaris sccsdiff calls diff, not bdiff.

Options

-p
Pipe output through pr.

-sn
Use file segment size n (n is passed to bdiff).

unget

unget [options] files

Cancel a previous get -e for one or more SCCS files. If a file is being edited via get -e, issuing delta processes the edits (creating a new delta), whereas unget deletes the edited version (preventing a new delta from being made).

Options

-n
Do not remove file retrieved with get -e.

-rsid
The SCCS ID of the delta to cancel; needed only if get -e is issued more than once for the same SCCS file.

-s
Suppress display of the intended delta's sid.

val

val [options] files

Validate that the SCCS files meet the characteristics specified in the options. val produces messages on the standard output for each file and returns an 8-bit code upon exit. The codes are described in “Return Value Bits”; bits are counted left to right.

Options

-
Read standard input and interpret each line as a val command-line argument. Exit with an EOF. This option is used by itself.

-mname
Compare name with %M% keyword in file.

-rsid
Check whether the SCCS ID is ambiguous or invalid.

-s
Silence any error message.

-ytype
Compare type with %Y% keyword in file.

Return Value Bits

BitMeaning
0

Missing file argument.

1

Unknown or duplicate option.

2

Corrupted SCCS file.

3

Cannot open file, or file is not an SCCS file.

4

SID is invalid or ambiguous.

5

Nonexistent SID.

6

Mismatch between type and -y argument.

7

Mismatch between filename and -m argument.

what

what [option] files

Search files for the pattern @(#) and print the text that follows it. (Typically, files are binary executables.) Actually, the pattern searched for is the value of %Z%, but the get command expands this keyword to @(#). The main purpose of what is to print identification strings.

Option

-s
Quit after finding the first occurrence of a pattern.



Library Navigation Links

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