# prs

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           prs — print an SCCS file (**DEVELOPMENT**)
    


## SYNOPSIS



           prs **[** -a**] [** -d _dataspec_**] [** -r**[**_SID_**]]**_file_...
    
           prs **[** -e|-l**]** -c _cutoff_ **[** -d _dataspec_**]**_file_...
    
           prs **[** -e|-l**]** -r**[**_SID_**] [** -d _dataspec_**]**_file_...
    


## DESCRIPTION



           The _prs_ utility shall write to standard output parts or all of an
           SCCS file in a user-supplied format.
    


## OPTIONS



           The _prs_ utility shall conform to the Base Definitions volume of
           POSIX.1‐2017, _Section 12.2_ , _Utility Syntax Guidelines_ , except that
           the **-r** option has an optional option-argument. This optional
           option-argument cannot be presented as a separate argument. The
           following options shall be supported:
    
           **-d** _dataspec_
                     Specify the output data specification. The _dataspec_
                     shall be a string consisting of SCCS file _data keywords_
                     (see _Data Keywords_) interspersed with optional user-
                     supplied text.
    
           **-r[**_SID_**]** Specify the SCCS identification string (SID) of a delta
                     for which information is desired. If no _SID_ option-
                     argument is specified, the SID of the most recently
                     created delta shall be assumed.
    
           **-e** Request information for all deltas created earlier than
                     and including the delta designated via the **-r** option or
                     the date-time given by the **-c** option.
    
           **-l** Request information for all deltas created later than
                     and including the delta designated via the **-r** option or
                     the date-time given by the **-c** option.
    
           **-c** _cutoff_ Indicate the _cutoff_ date-time, in the form:
    
                         _YY_**[**_MM_**[**_DD_**[**_HH_**[**_MM_**[**_SS_**]]]]]**
    
                     For the _YY_ component, values in the range [69,99] shall
                     refer to years 1969 to 1999 inclusive, and values in the
                     range [00,68] shall refer to years 2000 to 2068
                     inclusive.
    
                     **Note:** It is expected that in a future version of this
                            standard the default century inferred from a
                            2-digit year will change. (This would apply to
                            all commands accepting a 2-digit year as input.)
    
                     No changes (deltas) to the SCCS file that were created
                     after the specified _cutoff_ date-time shall be included
                     in the output. Units omitted from the date-time default
                     to their maximum possible values; for example, **-c 7502**
                     is equivalent to **-c 750228235959**.
    
           **-a** Request writing of information for both removed—that is,
                     _delta type_ =_R_ (see rmdel(1p))—and existing—that is, _delta_
                     _type_ =_D_ ,—deltas. If the **-a** option is not specified,
                     information for existing deltas only shall be provided.
    


## OPERANDS



           The following operand shall be supported:
    
           _file_      A pathname of an existing SCCS file or a directory. If
                     _file_ is a directory, the _prs_ utility shall behave as
                     though each file in the directory were specified as a
                     named file, except that non-SCCS files (last component
                     of the pathname does not begin with **s.**)  and unreadable
                     files shall be silently ignored.
    
                     If exactly one _file_ operand appears, and it is **'-'** , the
                     standard input shall be read; each line of the standard
                     input shall be taken to be the name of an SCCS file to
                     be processed. Non-SCCS files and unreadable files shall
                     be silently ignored.
    


## STDIN



           The standard input shall be a text file used only when the _file_
           operand is specified as **'-'**.  Each line of the text file shall be
           interpreted as an SCCS pathname.
    


## INPUT FILES



           Any SCCS files displayed are files of an unspecified format.
    


## ENVIRONMENT VARIABLES



           The following environment variables shall affect the execution of
           _prs_ :
    
           _LANG_      Provide a default value for the internationalization
                     variables that are unset or null. (See the Base
                     Definitions volume of POSIX.1‐2017, _Section 8.2_ ,
                     _Internationalization Variables_ the precedence of
                     internationalization variables used to determine the
                     values of locale categories.)
    
           _LC_ALL_    If set to a non-empty string value, override the values
                     of all the other internationalization variables.
    
           _LC_CTYPE_  Determine the locale for the interpretation of sequences
                     of bytes of text data as characters (for example,
                     single-byte as opposed to multi-byte characters in
                     arguments and input files).
    
           _LC_MESSAGES_
                     Determine the locale that should be used to affect the
                     format and contents of diagnostic messages written to
                     standard error.
    
           _NLSPATH_   Determine the location of message catalogs for the
                     processing of _LC_MESSAGES_.
    


## ASYNCHRONOUS EVENTS



           Default.
    


## STDOUT



           The standard output shall be a text file whose format is dependent
           on the data keywords specified with the **-d** option.
    
       **Data Keywords**
           Data keywords specify which parts of an SCCS file shall be
           retrieved and output. All parts of an SCCS file have an associated
           data keyword. A data keyword may appear in a _dataspec_ multiple
           times.
    
           The information written by _prs_ shall consist of:
    
            1. The user-supplied text
    
            2. Appropriate values (extracted from the SCCS file) substituted
               for the recognized data keywords in the order of appearance in
               the _dataspec_
    
           The format of a data keyword value shall either be simple (**'S'**),
           in which keyword substitution is direct, or multi-line (**'M'**).
    
           User-supplied text shall be any text other than recognized data
           keywords. A <tab> shall be specified by **'\t'** and <newline> by
           **'\n'**.  When the **-r** option is not specified, the default _dataspec_
           shall be:
    
               :PN::\n\n
    
           and the following _dataspec_ shall be used for each selected delta:
    
               :Dt:\t:DL:\nMRs:\n:MR:COMMENTS:\n:C:
    
    ┌──────────────────────────────────────────────────────────────────────────────────────┐
    │                               **SCCS File Data Keywords** │
    ├─────────┬────────────────────────────────┬──────────────┬───────────────────┬────────┤
    │ **Keyword** │           **Data Item** │ **File Section** │       **Value** │ **Format** │
    ├─────────┼────────────────────────────────┼──────────────┼───────────────────┼────────┤
    │ **:Dt:** │ Delta information              │ Delta Table  │ See below*        │   S    │
    │ **:DL:** │ Delta line statistics          │      "       │ **:Li:/:Ld:/:Lu:** │   S    │
    │ **:Li:** │ Lines inserted by Delta        │      "       │ _nnnnn_ ***          │   S    │
    │ **:Ld:** │ Lines deleted by Delta         │      "       │ _nnnnn_ ***          │   S    │
    │ **:Lu:** │ Lines unchanged by Delta       │      "       │ _nnnnn_ ***          │   S    │
    │ **:DT:** │ Delta type                     │      "       │ **D or R** │   S    │
    │ **:I:** │ SCCS ID string (SID)           │      "       │ See below**       │   S    │
    │ **:R:** │ Release number                 │      "       │ _nnnn_              │   S    │
    │ **:L:** │ Level number                   │      "       │ _nnnn_              │   S    │
    │ **:B:** │ Branch number                  │      "       │ _nnnn_              │   S    │
    │ **:S:** │ Sequence number                │      "       │ _nnnn_              │   S    │
    │ **:D:** │ Date delta created             │      "       │ **:Dy:/:Dm:/:Dd:** │   S    │
    │ **:Dy:** │ Year delta created             │      "       │ _nn_                │   S    │
    │ **:Dm:** │ Month delta created            │      "       │ _nn_                │   S    │
    │ **:Dd:** │ Day delta created              │      "       │ _nn_                │   S    │
    │ **:T:** │ Time delta created             │      "       │ **:Th:::Tm:::Ts:** │   S    │
    │ **:Th:** │ Hour delta created             │      "       │ _nn_                │   S    │
    │ **:Tm:** │ Minutes delta created          │      "       │ _nn_                │   S    │
    │ **:Ts:** │ Seconds delta created          │      "       │ _nn_                │   S    │
    │ **:P:** │ Programmer who created Delta   │      "       │ _logname_           │   S    │
    │ **:DS:** │ Delta sequence number          │      "       │ _nnnn_              │   S    │
    │ **:DP:** │ Predecessor Delta sequence     │      "       │ _nnnn_              │   S    │
    │         │ number                         │              │                   │        │
    │ **:DI:** │ Sequence number of deltas      │      "       │ **:Dn:/:Dx:/:Dg:** │   S    │
    │         │ included, excluded, or ignored │              │                   │        │
    │ **:Dn:** │ Deltas included (sequence #)   │      "       │ **:DS: :DS: ...** │   S    │
    │ **:Dx:** │ Deltas excluded (sequence #)   │      "       │ **:DS: :DS: ...** │   S    │
    │ **:Dg:** │ Deltas ignored (sequence #)    │      "       │ **:DS: :DS: ...** │   S    │
    │ **:MR:** │ MR numbers for delta           │      "       │ _text_              │   M    │
    │ **:C:** │ Comments for delta             │      "       │ _text_              │   M    │
    │ **:UN:** │ User names                     │  User Names  │ _text_              │   M    │
    │ **:FL:** │ Flag list                      │    Flags     │ _text_              │   M    │
    │ **:Y:** │ Module type flag               │      "       │ _text_              │   S    │
    │ **:MF:** │ MR validation flag             │      "       │ **yes** or **no** │   S    │
    │ **:MP:** │ MR validation program name     │      "       │ _text_              │   S    │
    │ **:KF:** │ Keyword error, warning flag    │      "       │ **yes** or **no** │   S    │
    │ **:KV:** │ Keyword validation string      │      "       │ _text_              │   S    │
    │ **:BF:** │ Branch flag                    │      "       │ **yes** or **no** │   S    │
    │ **:J:** │ Joint edit flag                │      "       │ **yes** or **no** │   S    │
    │ **:LK:** │ Locked releases                │      "       │ **:R: ...** │   S    │
    │ **:Q:** │ User-defined keyword           │      "       │ _text_              │   S    │
    │ **:M:** │ Module name                    │      "       │ _text_              │   S    │
    │ **:FB:** │ Floor boundary                 │      "       │ **:R:** │   S    │
    │ **:CB:** │ Ceiling boundary               │      "       │ **:R:** │   S    │
    │ **:Ds:** │ Default SID                    │      "       │ **:I:** │   S    │
    │ **:ND:** │ Null delta flag                │      "       │ **yes** or **no** │   S    │
    │ **:FD:** │ File descriptive text          │   Comments   │ _text_              │   M    │
    │ **:BD:** │ Body                           │     Body     │ _text_              │   M    │
    │ **:GB:** │ Gotten body                    │      "       │ _text_              │   M    │
    │ **:W:** │ A form of _what_ string          │     N/A      │ **:Z::M:\t:I:** │   S    │
    │ **:A:** │ A form of _what_ string          │     N/A      │ **:Z::Y: :M: :I::Z:** │   S    │
    │ **:Z:** │ _what_ string delimiter          │     N/A      │ @(#)              │   S    │
    │ **:F:** │ SCCS filename                  │     N/A      │ _text_              │   S    │
    │ **:PN:** │ SCCS file pathname             │     N/A      │ _text_              │   S    │
    └─────────┴────────────────────────────────┴──────────────┴───────────────────┴────────┘
    
           *     **:Dt:** =**:DT: :I: :D: :T: :P: :DS: :DP:**
    
           **    **:R:.:L:.:B:.:S:** if the delta is a branch delta (**:BF:** ==**yes**)
                 **:R:.:L:** if the delta is not a branch delta (**:BF:** ==**no**)
    
           ***   The line statistics are capped at 99999. For example, if
                 100000 lines were unchanged in a certain revision, **:Lu:**
                 shall produce the value 99999.
    


## STDERR



           The standard error shall be used only for diagnostic messages.
    


## OUTPUT FILES



           None.
    


## EXTENDED DESCRIPTION



           None.
    


## EXIT STATUS



           The following exit values shall be returned:
    
            0    Successful completion.
    
           >0    An error occurred.
    


## CONSEQUENCES OF ERRORS



           Default.
    
           _The following sections are informative._
    


## APPLICATION USAGE



           None.
    


## EXAMPLES



            1. The following example:
    
                   prs -d "User Names for :F: are:\n:UN:" s.file
    
               might write to standard output:
    
                   User Names for s.file are:
                   xyz
                   131
                   abc
    
            2. The following example:
    
                   prs -d "Delta for pgm :M:: :I: - :D: By :P:" -r s.file
    
               might write to standard output:
    
                   Delta for pgm main.c: 3.7 - 77/12/01 By cas
    
            3. As a special case:
    
                   prs s.file
    
               might write to standard output:
    
                   s.file:
                   <_blank line_ >
                   D 1.1 77/12/01 00:00:00 cas 1 000000/00000/00000
                   MRs:
                   bl78-12345
                   bl79-54321
                   COMMENTS:
                   this is the comment line for s.file initial delta
                   <_blank line_ >
    
               for each delta table entry of the **D** type. The only option
               allowed to be used with this special case is the **-a** option.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           None.
    


* * *