# delta

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



           delta — make a delta (change) to an SCCS file (**DEVELOPMENT**)
    


## SYNOPSIS



           delta **[** -nps**] [** -g _list_**] [** -m _mrlist_**] [** -r _SID_**] [** -y**[**_comment_**]]**_file_...
    


## DESCRIPTION



           The _delta_ utility shall be used to permanently introduce into the
           named SCCS files changes that were made to the files retrieved by
           _get_ (called the _g-files_ , or generated files).
    


## OPTIONS



           The _delta_ utility shall conform to the Base Definitions volume of
           POSIX.1‐2017, _Section 12.2_ , _Utility Syntax Guidelines_ , except that
           the **-y** option has an optional option-argument. This optional
           option-argument shall not be presented as a separate argument.
    
           The following options shall be supported:
    
           **-r** _SID_    Uniquely identify which delta is to be made to the SCCS
                     file. The use of this option shall be necessary only if
                     two or more outstanding _get_ commands for editing (_get_
                     **-e**) on the same SCCS file were done by the same person
                     (login name). The SID value specified with the **-r** option
                     can be either the SID specified on the _get_ command line
                     or the SID to be made as reported by the _get_ utility;
                     see get(1p).
    
           **-s** Suppress the report to standard output of the activity
                     associated with each _file_.  See the STDOUT section.
    
           **-n** Specify retention of the edited _g-file_ (normally removed
                     at completion of delta processing).
    
           **-g** _list_   Specify a _list_ (see get(1p) for the definition of _list_)
                     of deltas that shall be ignored when the file is
                     accessed at the change level (SID) created by this
                     delta.
    
           **-m** _mrlist_ Specify a modification request (MR) number that the
                     application shall supply as the reason for creating the
                     new delta. This shall be used if the SCCS file has the **v**
                     flag set; see admin(1p).
    
                     If **-m** is not used and **'-'** is not specified as a file
                     argument, and the standard input is a terminal, the
                     prompt described in the STDOUT section shall be written
                     to standard output before the standard input is read; if
                     the standard input is not a terminal, no prompt shall be
                     issued.
    
                     MRs in a list shall be separated by <blank> characters
                     or escaped <newline> characters. An unescaped <newline>
                     shall terminate the MR list. The escape character is
                     <backslash>.
    
                     If the **v** flag has a value, it shall be taken to be the
                     name of a program which validates the correctness of the
                     MR numbers. If a non-zero exit status is returned from
                     the MR number validation program, the _delta_ utility
                     shall terminate. (It is assumed that the MR numbers were
                     not all valid.)
    
           **-y[**_comment_**]**
                     Describe the reason for making the delta. The _comment_
                     shall be an arbitrary group of lines that would meet the
                     definition of a text file. Implementations shall support
                     _comment_ s from zero to 512 bytes and may support longer
                     values. A null string (specified as either **-y** , **-y""** , or
                     in response to a prompt for a comment) shall be
                     considered a valid _comment_.
    
                     If **-y** is not specified and **'-'** is not specified as a
                     file argument, and the standard input is a terminal, the
                     prompt described in the STDOUT section shall be written
                     to standard output before the standard input is read; if
                     the standard input is not a terminal, no prompt shall be
                     issued. An unescaped <newline> shall terminate the
                     comment text. The escape character is <backslash>.
    
                     The **-y** option shall be required if the _file_ operand is
                     specified as **'-'**.
    
           **-p** Write (to standard output) the SCCS file differences
                     before and after the delta is applied in _diff_ format;
                     see diff(1p).
    


## OPERANDS



           The following operand shall be supported:
    
           _file_      A pathname of an existing SCCS file or a directory. If
                     _file_ is a directory, the _delta_ 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 in the following
           cases:
    
            *  To read an _mrlist_ or a _comment_ (see the **-m** and **-y** options).
    
            *  A _file_ operand shall be specified as **'-'**.  In this case, the
               **-y** option must be used to specify the comment, and if the SCCS
               file has the **v** flag set, the **-m** option must also be used to
               specify the MR list.
    


## INPUT FILES



           Input files shall be text files whose data is to be included in
           the SCCS files. If the first character of any line of an input
           file is <SOH> in the POSIX locale, the results are unspecified. If
           this file contains more than 99999 lines, the number of lines
           recorded in the header for this file shall be 99999 for this
           delta.
    


## ENVIRONMENT VARIABLES



           The following environment variables shall affect the execution of
           _delta_ :
    
           _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_ for 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, and informative messages written to
                     standard output.
    
           _NLSPATH_   Determine the location of message catalogs for the
                     processing of _LC_MESSAGES_.
    
           _TZ_        Determine the timezone in which the time and date are
                     written in the SCCS file. If the _TZ_ variable is unset or
                     NULL, an unspecified system default timezone is used.
    


## ASYNCHRONOUS EVENTS



           If SIGINT is caught, temporary files shall be cleaned up and _delta_
           shall exit with a non-zero exit code. The standard action shall be
           taken for all other signals; see _Section 1.4_ , _Utility Description_
           _Defaults_.
    


## STDOUT



           The standard output shall be used only for the following messages
           in the POSIX locale:
    
            *  Prompts (see the **-m** and **-y** options) in the following formats:
    
                   "MRs? "
    
                   "comments? "
    
               The MR prompt, if written, shall always precede the comments
               prompt.
    
            *  A report of each file's activities (unless the **-s** option is
               specified) in the following format:
    
                   "%s\n%d inserted\n%d deleted\n%d unchanged\n", <_New SID_ >,
                       <_number of lines inserted_ >, <_number of lines deleted_ >,
                       <_number of lines unchanged_ >
    


## STDERR



           The standard error shall be used only for diagnostic messages.
    


## OUTPUT FILES



           Any SCCS files updated shall be files of an unspecified format.
    


## EXTENDED DESCRIPTION



       **System Date and Time**
           When a delta is added to an SCCS file, the system date and time
           shall be recorded for the new delta. If a _get_ is performed using
           an SCCS file with a date recorded apparently in the future, the
           behavior is unspecified.
    


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



           Problems can arise if the system date and time have been modified
           (for example, put forward and then back again, or unsynchronized
           clocks across a network) and can also arise when different values
           of the _TZ_ environment variable are used.
    
           Problems of a similar nature can also arise for the operation of
           the _get_ utility, which records the date and time in the file body.
    


## EXAMPLES



           None.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           None.
    


* * *