VAL(1)                     POSIX Programmer's Manual                    VAL(1)



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

NNAAMMEE
       val -- validate SCCS files (DDEEVVEELLOOPPMMEENNTT)

SSYYNNOOPPSSIISS
       val -

       val [[-s]] [[-m _n_a_m_e]] [[-r _S_I_D]] [[-y _t_y_p_e]] _f_i_l_e...

DDEESSCCRRIIPPTTIIOONN
       The _v_a_l utility shall determine whether the specified _f_i_l_e is an SCCS
       file meeting the characteristics specified by the options.

OOPPTTIIOONNSS
       The _v_a_l utility shall conform to the Base Definitions volume of
       POSIX.1-2017, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s, except that the
       usage of the ''--'' operand is not strictly as intended by the guidelines
       (that is, reading options and operands from standard input).

       The following options shall be supported:

       --mm _n_a_m_e   Specify a _n_a_m_e, which is compared with the SCCS %MM% keyword
                 in _f_i_l_e; see _g_e_t.

       --rr _S_I_D    Specify a _S_I_D (SCCS Identification String), an SCCS delta
                 number. A check shall be made to determine whether the _S_I_D is
                 ambiguous (for example, --rr 11 is ambiguous because it
                 physically does not exist but implies 1.1, 1.2, and so on,
                 which may exist) or invalid (for example, --rr 11..00 or --rr 11..11..00
                 are invalid because neither case can exist as a valid delta
                 number).  If the _S_I_D is valid and not ambiguous, a check
                 shall be made to determine whether it actually exists.

       --ss        Silence the diagnostic message normally written to standard
                 output for any error that is detected while processing each
                 named file on a given command line.

       --yy _t_y_p_e   Specify a _t_y_p_e, which shall be compared with the SCCS %YY%
                 keyword in _f_i_l_e; see _g_e_t.

OOPPEERRAANNDDSS
       The following operands shall be supported:

       _f_i_l_e      A pathname of an existing SCCS file. If exactly one _f_i_l_e
                 operand appears, and it is ''--'', the standard input shall be
                 read: each line shall be independently processed as if it
                 were a command line argument list. (However, the line is not
                 subjected to any of the shell word expansions, such as
                 parameter expansion or quote removal.)

SSTTDDIINN
       The standard input shall be a text file used only when the _f_i_l_e operand
       is specified as ''--''.

IINNPPUUTT FFIILLEESS
       Any SCCS files processed shall be files of an unspecified format.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The following environment variables shall affect the execution of _v_a_l:

       _L_A_N_G      Provide a default value for the internationalization
                 variables that are unset or null. (See the Base Definitions
                 volume of POSIX.1-2017, _S_e_c_t_i_o_n _8_._2, _I_n_t_e_r_n_a_t_i_o_n_a_l_i_z_a_t_i_o_n
                 _V_a_r_i_a_b_l_e_s for the precedence of internationalization
                 variables used to determine the values of locale categories.)

       _L_C___A_L_L    If set to a non-empty string value, override the values of
                 all the other internationalization variables.

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

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

       _N_L_S_P_A_T_H   Determine the location of message catalogs for the processing
                 of _L_C___M_E_S_S_A_G_E_S.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       The standard output shall consist of informative messages about either:

        1. Each file processed

        2. Each command line read from standard input

       If the standard input is not used, for each _f_i_l_e operand yielding a
       discrepancy, the output line shall have the following format:


           "%s: %s\n", <_p_a_t_h_n_a_m_e>, <_u_n_s_p_e_c_i_f_i_e_d _s_t_r_i_n_g>

       If the standard input is used, for each input line yielding a
       discrepancy, the output shall have the following format:


           "%s\n\n %s: %s\n", <_i_n_p_u_t>, <_p_a_t_h_n_a_m_e>, <_u_n_s_p_e_c_i_f_i_e_d _s_t_r_i_n_g>

       where <_i_n_p_u_t> is the input line minus its terminating <newline>.

SSTTDDEERRRR
       Not used.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       None.

EEXXIITT SSTTAATTUUSS
       The 8-bit code returned by _v_a_l shall be a disjunction of the possible
       errors; that is, it can be interpreted as a bit string where set bits
       are interpreted as follows:

       0x80   =   Missing file argument.
       0x40   =   Unknown or duplicate option.

       0x20   =   Corrupted SCCS file.
       0x10   =   Cannot open file or file not SCCS.
       0x08   =   _S_I_D is invalid or ambiguous.
       0x04   =   _S_I_D does not exist.
       0x02   =   %YY%, --yy mismatch.
       0x01   =   %MM%, --mm mismatch.

       Note that _v_a_l can process two or more files on a given command line and
       can process multiple command lines (when reading the standard input).
       In these cases an aggregate code shall be returned: a logical OR of the
       codes generated for each command line and file processed.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       Default.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       Since the _v_a_l exit status sets the 0x80 bit, shell applications
       checking ""$$??"" cannot tell if it terminated due to a missing file
       argument or receipt of a signal.

EEXXAAMMPPLLEESS
       In a directory with three SCCS files--ss..xx (of tt type ``text''), ss..yy,
       and ss..zz (a corrupted file)--the following command could produce the
       output shown:


           val - <<EOF
           -y source s.x
           -m y s.y
           s.z
           EOF
           -y source s.x

               s.x: %Y%, -y mismatch
           s.z

               s.z: corrupted SCCS file

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _a_d_m_i_n, _d_e_l_t_a, _g_e_t, _p_r_s

       The Base Definitions volume of POSIX.1-2017, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t
       _V_a_r_i_a_b_l_e_s, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                               VAL(1)
