prs Command (SCCS)

Purpose

Displays a Source Code Control System (SCCS) file.

Syntax

prs [ -a ] [ -d String ] [ -r [ SID ] | [ -c Cutoff ] ] [ -e | -l ] File ...

Description

The prs command first reads the specified files and then writes to standard output a part or all of a Source Code Control System (SCCS) file. If you specify a directory for the File parameter, the prs command performs the requested actions on all SCCS files (those with the s. prefix). If you specify a - (minus) for the File parameter, the prs command reads standard input and interprets each line as the name of an SCCS file. The prs command continues to read input until it reaches an end-of-file character.

Data Keywords

Data keywords specify the parts of an SCCS file to be retrieved and written to standard output. All parts of an SCCS file have an associated data keyword. There is no limit to the number of times a data keyword can be in a specified file.

The information that the prs command displays consists of user-supplied text and appropriate values (extracted from the SCCS file) substituted for the recognized data keywords in the order they are displayed in the specified file. The format of a data keyword value is either simple, in which the keyword substitution is direct, or multiline, in which the substitution is followed by a carriage return. Text consists of any characters other than recognized data keywords. Specify a tab character with \t (backslash, letter t) and a carriage return or new-line character with a \n (backslash, letter n). Remember to use the \t and \n with an extra \ (backslash) to prevent the shell from interpreting the \ and passing only the letter t or n to the prs command as text.

The following table lists the keywords associated with information in the delta table of the SCCS file. All the keywords have a simple format unless otherwise indicated.

Delta Table Keywords
Keyword Data Represented Value
:R: Release number num
:L: Level number num
:B: Branch number num
:S: Sequence number num
:I: SCCS ID string (SID) :R::L::B::S:
:Dy: Year delta created YY
:Dm: Month delta created MM
:Dd: Day delta created DD
:D: Date delta created YY/MM/DD
:Th: Hour delta created HH
:Tm: Minute delta created MM
:Ts: Second delta created SS
:T: Time delta created HH/MM/SS
:DT: Delta type D or R
Item Description Value
:P: User who created the delta login name
:DS: Delta sequence number num
:DP: Previous delta sequence number num
:Dt: Delta information :DT::I::D::T::P::DS::DP:
:Dn: Sequence numbers of deltas included :DS: . . .
:Dx: Sequence numbers of deltas excluded :DS: . . .
:Dg: Sequence numbers of deltas ignored :DS: . . .
:DI: Sequence numbers of deltas included,excluded, and ignored :Dn:/:Dx:/:Dg:
:Li: Lines inserted by delta num
:Ld: Lines deleted by delta num
:Lu: Lines unchanged by delta num
:DL: Delta line statistics :Li:/:Ld:/:Lu:
:MR: (multiline format) MR numbers for delta text
:C: (multiline format Comments for delta text

The following table lists the keywords associated with header flags in the SCCS file. All the keywords have a simple format unless otherwise indicated.

Header Flag Keywords
Keyword Data Represented Value
:Y: Module type text
:MF: MR validation flag set yes or no
:MP: MR validation program name text
:KF: Keyword/error warning flag set yes or no
:BF: Branch flag set yes or no
:J: Joint edit flag set yes or no
:LK: Locked releases :R: . . .
:Q: User-defined keyword text
:M: Module name text
:FB: Floor boundary :R:
:CB: Ceiling boundary :R:
:Ds: Default SID :I:
:ND: Null Delta flag set yes or no
:FL: (multiline format) Header flag list text

The following table lists the keywords associated with other parts of the SCCS file. All the keywords have a simple format unless otherwise indicated.

Other Keywords
Keyword Data Represented Value
:UN: (multiline format) User names text
:FD: (multiline format) Descriptive text text
:BD: (multiline format) Body of text text
:GB: (multiline format) Text in a g-file text
:W: A what string :Z::M: \tab :I:
:A: A what string :Z::Y::M::I::Z:
:Z: A what string delimiter @(#)
:F: SCCS file name text
:PN: SCCS file path name text

Flags

Each flag or group of flags applies independently to each named file.

Item Description
-a Writes information for the specified deltas, whether or not they have been removed (see the rmdel command). If you do not specify the -a flag, the prs command supplies information only for the specified deltas that have not been removed.
-c Cutoff Specifies a cutoff date and time for the -e and -l flags. Specify the Cutoff value in the following form:
YY[MM[DD[HH[MM[SS]]]]]

All omitted items default to their maximum values, so specifying -c8402 is the same as specifying -c840229235959. You can separate the fields with any non-numeric character. For example, you can specify -c84/2/20,9:22:25 or -c"84/2/20 9:22:25" or "-c84/2/20 9:22:25". The -c flag cannot be specified with the -r flag.

-d String Specifies the data items to be displayed. The string consists of optional text and SCCS file-data keywords. The string may include MBCS (multibyte character set) characters. If the string contains spaces, you must enclose the string in quotation marks.
-e Requests information for all deltas created earlier than and including the delta specified by the -r flag.
-l Requests information for all deltas created later than and including the delta specified by the -r flag.
-r [SID] Specifies the SCCS ID string (SID) of the delta for which the prs command will retrieve information. Do not enter a space between the -r flag and the optional SID parameter. If no SID is specified, the command retrieves the information for the SID of the highest numbered delta. The -r flag cannot be specified with the -c flag.

Exit Status

This command returns the following exit values:

Item Description
0 Successful completion.
>0 An error occurred.

Examples

  1. To display information on all deltas generated for SCCS file name s.test.c (including all deltas removed using the rmdel command), type:
    prs -a s.test.c
  2. To display user login name, the number of lines inserted by delta, and the number of lines deleted by delta for SID 1.2 of s.test.c, type:
    prs -r1.2 -d":P:\n:Li:\n:Ld:" s.test.c

Files

Item Description
/usr/bin/prs Contains the prs command.