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

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 [options] files

Add files to SCCS or change options of SCCS files.


-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.

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.

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


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


Set highest release to n (default is 9999).


Set get's default delta number to n.


Set lowest release to n (default is 1).


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.


Allow multiple concurrent get s.


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


Substitute %M% keyword with module name.


Create a null delta from which to branch.


Substitute %Q% keyword with string.


Substitute %Y% keyword with module type.


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.

Set flag (see -d above).

Check an existing SCCS file for possible corruption.

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.

Insert list of modification request numbers as the reason for creating the file.

Create a new SCCS file that is empty.

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

Replace SCCS file description with contents of file. If file is missing, the existing description is deleted.

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

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


cdc -rsid [options] files

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


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.

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


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 [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.


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.

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.

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

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 [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.


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

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.

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.

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

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

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

Suppress printing of new SID and other delta information.

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


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.


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

Create new branch (use with -e).

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.

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

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

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

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).

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

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

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

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

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

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.

Suppress normal output (show error messages only).

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

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

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


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 [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


When everything else fails, try this:

help stuck

prs [options] files

Print formatted information for one or more SCCS files.


Include information for all deltas, including removed ones.

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

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.

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

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

Specify SCCS ID sid; default is the most recent delta.


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 [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.


Display entries for all deltas, including removed ones.

Print the body of the SCCS file.

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.

Print delta table entries. This is the default action.

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

Print the flags for each SCCS file.

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

Exclude deltas that are newer than date.

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

Print the SCCS file's descriptive text.

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

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 -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 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 -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.


Pipe output through pr.

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


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).


Do not remove file retrieved with get -e.

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

Suppress display of the intended delta's sid.


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.


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

Compare name with %M% keyword in file.

Check whether the SCCS ID is ambiguous or invalid.

Silence any error message.

Compare type with %Y% keyword in file.

Return Value Bits


Missing file argument.


Unknown or duplicate option.


Corrupted SCCS file.


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


SID is invalid or ambiguous.


Nonexistent SID.


Mismatch between type and -y argument.


Mismatch between filename and -m argument.


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.


Quit after finding the first occurrence of a pattern.

Library Navigation Links

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