TEST(1)                    POSIX Programmer's Manual                   TEST(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
       test -- evaluate expression

SSYYNNOOPPSSIISS
       test [[_e_x_p_r_e_s_s_i_o_n]]

       [ [[_e_x_p_r_e_s_s_i_o_n]] ]

DDEESSCCRRIIPPTTIIOONN
       The _t_e_s_t utility shall evaluate the _e_x_p_r_e_s_s_i_o_n and indicate the result
       of the evaluation by its exit status. An exit status of zero indicates
       that the expression evaluated as true and an exit status of 1 indicates
       that the expression evaluated as false.

       In the second form of the utility, which uses ""[[]]"" rather than _t_e_s_t,
       the application shall ensure that the square brackets are separate
       arguments.

OOPPTTIIOONNSS
       The _t_e_s_t utility shall not recognize the ""----"" argument in the manner
       specified by Guideline 10 in the Base Definitions volume of
       POSIX.1-2008, _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.

       No options shall be supported.

OOPPEERRAANNDDSS
       The application shall ensure that all operators and elements of
       primaries are presented as separate arguments to the _t_e_s_t utility.

       The following primaries can be used to construct _e_x_p_r_e_s_s_i_o_n:

       --bb _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to en existing directory entry for
                 a block special file.  False if _p_a_t_h_n_a_m_e cannot be resolved,
                 or if _p_a_t_h_n_a_m_e resolves to an existing directory entry for a
                 file that is not a block special file.

       --cc _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a character special file.  False if _p_a_t_h_n_a_m_e cannot be
                 resolved, or if _p_a_t_h_n_a_m_e resolves to an existing directory
                 entry for a file that is not a character special file.

       --dd _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a directory. False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 that is not a directory.

       --ee _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry.
                 False if _p_a_t_h_n_a_m_e cannot be resolved.

       --ff _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a regular file. False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 that is not a regular file.

       --gg _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file that has its set-group-ID flag set. False if _p_a_t_h_n_a_m_e
                 cannot be resolved, or if _p_a_t_h_n_a_m_e resolves to an existing
                 directory entry for a file that does not have its set-group-
                 ID flag set.

       --hh _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a symbolic link. False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 that is not a symbolic link. If the final component of
                 _p_a_t_h_n_a_m_e is a symbolic link, that symbolic link is not
                 followed.

       --LL _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a symbolic link. False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 that is not a symbolic link. If the final component of
                 _p_a_t_h_n_a_m_e is a symbolic link, that symbolic link is not
                 followed.

       --nn _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is non-zero; otherwise, false.

       --pp _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a FIFO. False if _p_a_t_h_n_a_m_e cannot be resolved, or if _p_a_t_h_n_a_m_e
                 resolves to an existing directory entry for a file that is
                 not a FIFO.

       --rr _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file for which permission to read from the file will be
                 granted, as defined in _S_e_c_t_i_o_n _1_._1_._1_._4, _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d
                 _C_r_e_a_t_i_o_n.  False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 for which permission to read from the file will not be
                 granted.

       --SS _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a socket. False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 that is not a socket.

       --ss _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file that has a size greater than zero. False if _p_a_t_h_n_a_m_e
                 cannot be resolved, or if _p_a_t_h_n_a_m_e resolves to an existing
                 directory entry for a file that does not have a size greater
                 than zero.

       --tt _f_i_l_e___d_e_s_c_r_i_p_t_o_r
                 True if file descriptor number _f_i_l_e___d_e_s_c_r_i_p_t_o_r is open and is
                 associated with a terminal. False if _f_i_l_e___d_e_s_c_r_i_p_t_o_r is not a
                 valid file descriptor number, or if file descriptor number
                 _f_i_l_e___d_e_s_c_r_i_p_t_o_r is not open, or if it is open but is not
                 associated with a terminal.

       --uu _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file that has its set-user-ID flag set. False if _p_a_t_h_n_a_m_e
                 cannot be resolved, or if _p_a_t_h_n_a_m_e resolves to an existing
                 directory entry for a file that does not have its set-user-ID
                 flag set.

       --ww _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file for which permission to write to the file will be
                 granted, as defined in _S_e_c_t_i_o_n _1_._1_._1_._4, _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d
                 _C_r_e_a_t_i_o_n.  False if _p_a_t_h_n_a_m_e cannot be resolved, or if
                 _p_a_t_h_n_a_m_e resolves to an existing directory entry for a file
                 for which permission to write to the file will not be
                 granted.

       --xx _p_a_t_h_n_a_m_e
                 True if _p_a_t_h_n_a_m_e resolves to an existing directory entry for
                 a file for which permission to execute the file (or search
                 it, if it is a directory) will be granted, as defined in
                 _S_e_c_t_i_o_n _1_._1_._1_._4, _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d _C_r_e_a_t_i_o_n.  False if
                 _p_a_t_h_n_a_m_e cannot be resolved, or if _p_a_t_h_n_a_m_e resolves to an
                 existing directory entry for a file for which permission to
                 execute (or search) the file will not be granted.

       --zz _s_t_r_i_n_g True if the length of string _s_t_r_i_n_g is zero; otherwise,
                 false.

       _s_t_r_i_n_g    True if the string _s_t_r_i_n_g is not the null string; otherwise,
                 false.

       _s_1 == _s_2   True if the strings _s_1 and _s_2 are identical; otherwise,
                 false.

       _s_1 !!== _s_2  True if the strings _s_1 and _s_2 are not identical; otherwise,
                 false.

       _n_1 --eeqq _n_2 True if the integers _n_1 and _n_2 are algebraically equal;
                 otherwise, false.

       _n_1 --nnee _n_2 True if the integers _n_1 and _n_2 are not algebraically equal;
                 otherwise, false.

       _n_1 --ggtt _n_2 True if the integer _n_1 is algebraically greater than the
                 integer _n_2; otherwise, false.

       _n_1 --ggee _n_2 True if the integer _n_1 is algebraically greater than or equal
                 to the integer _n_2; otherwise, false.

       _n_1 --lltt _n_2 True if the integer _n_1 is algebraically less than the integer
                 _n_2; otherwise, false.

       _n_1 --llee _n_2 True if the integer _n_1 is algebraically less than or equal to
                 the integer _n_2; otherwise, false.

       _e_x_p_r_e_s_s_i_o_n_1 --aa _e_x_p_r_e_s_s_i_o_n_2
                 True if both _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are true; otherwise,
                 false. The --aa binary primary is left associative. It has a
                 higher precedence than --oo.

       _e_x_p_r_e_s_s_i_o_n_1 --oo _e_x_p_r_e_s_s_i_o_n_2
                 True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true; otherwise,
                 false. The --oo binary primary is left associative.

       With the exception of the --hh _p_a_t_h_n_a_m_e and --LL _p_a_t_h_n_a_m_e primaries, if a
       _p_a_t_h_n_a_m_e argument is a symbolic link, _t_e_s_t shall evaluate the
       expression by resolving the symbolic link and using the file referenced
       by the link.

       These primaries can be combined with the following operators:

       !! _e_x_p_r_e_s_s_i_o_n
                 True if _e_x_p_r_e_s_s_i_o_n is false. False if _e_x_p_r_e_s_s_i_o_n is true.

       (( _e_x_p_r_e_s_s_i_o_n ))
                 True if _e_x_p_r_e_s_s_i_o_n is true. False if _e_x_p_r_e_s_s_i_o_n is false. The
                 parentheses can be used to alter the normal precedence and
                 associativity.

       The primaries with two elements of the form:

           --_p_r_i_m_a_r_y___o_p_e_r_a_t_o_r _p_r_i_m_a_r_y___o_p_e_r_a_n_d

       are known as _u_n_a_r_y _p_r_i_m_a_r_i_e_s.  The primaries with three elements in
       either of the two forms:

           _p_r_i_m_a_r_y___o_p_e_r_a_n_d -_p_r_i_m_a_r_y___o_p_e_r_a_t_o_r _p_r_i_m_a_r_y___o_p_e_r_a_n_d

           primary_operand primary_operator primary_operand

       are known as _b_i_n_a_r_y _p_r_i_m_a_r_i_e_s.  Additional implementation-defined
       operators and _p_r_i_m_a_r_y___o_p_e_r_a_t_o_rs may be provided by implementations.
       They shall be of the form -_o_p_e_r_a_t_o_r where the first character of
       _o_p_e_r_a_t_o_r is not a digit.

       The algorithm for determining the precedence of the operators and the
       return value that shall be generated is based on the number of
       arguments presented to _t_e_s_t.  (However, when using the ""[[......]]"" form,
       the <right-square-bracket> final argument shall not be counted in this
       algorithm.)

       In the following list, $1, $2, $3, and $4 represent the arguments
       presented to _t_e_s_t:

       0 arguments:
                   Exit false (1).

       1 argument: Exit true (0) if $1 is not null; otherwise, exit false.

       2 arguments:
                    *  If $1 is ''!!'', exit true if $2 is null, false if $2 is
                       not null.

                    *  If $1 is a unary primary, exit true if the unary test
                       is true, false if the unary test is false.

                    *  Otherwise, produce unspecified results.

       3 arguments:
                    *  If $2 is a binary primary, perform the binary test of
                       $1 and $3.

                    *  If $1 is ''!!'', negate the two-argument test of $2 and
                       $3.

                    *  If $1 is ''(('' and $3 is ''))'', perform the unary test of
                       $2.  On systems that do not support the XSI option, the
                       results are unspecified if $1 is ''(('' and $3 is ''))''.

                    *  Otherwise, produce unspecified results.

       4 arguments:
                    *  If $1 is ''!!'', negate the three-argument test of $2, $3,
                       and $4.

                    *  If $1 is ''(('' and $4 is ''))'', perform the two-argument
                       test of $2 and $3.  On systems that do not support the
                       XSI option, the results are unspecified if $1 is ''((''
                       and $4 is ''))''.

                    *  Otherwise, the results are unspecified.

       >4 arguments:
                   The results are unspecified.

                   On XSI-conformant systems, combinations of primaries and
                   operators shall be evaluated using the precedence and
                   associativity rules described previously. In addition, the
                   string comparison binary primaries ''=='' and ""!!=="" shall have
                   a higher precedence than any unary primary.

SSTTDDIINN
       Not used.

IINNPPUUTT FFIILLEESS
       None.

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

       _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-2008, _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).

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

       _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
       Not used.

SSTTDDEERRRR
       The standard error shall be used only for diagnostic messages.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       None.

EEXXIITT SSTTAATTUUSS
       The following exit values shall be returned:

        0    _e_x_p_r_e_s_s_i_o_n evaluated to true.

        1    _e_x_p_r_e_s_s_i_o_n evaluated to false or _e_x_p_r_e_s_s_i_o_n was missing.

       >1    An error occurred.

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
       The XSI extensions specifying the --aa and --oo binary primaries and the
       ''(('' and ''))'' operators have been marked obsolescent. (Many expressions
       using them are ambiguously defined by the grammar depending on the
       specific expressions being evaluated.) Scripts using these expressions
       should be converted to the forms given below. Even though many
       implementations will continue to support these obsolescent forms,
       scripts should be extremely careful when dealing with user-supplied
       input that could be confused with these and other primaries and
       operators. Unless the application developer knows all the cases that
       produce input to the script, invocations like:

           tteesstt ""$$11"" --aa ""$$22""

       should be written as:

           tteesstt ""$$11"" &&&& tteesstt ""$$22""

       to avoid problems if a user supplied values such as $1 set to ''!!''  and
       $2 set to the null string. That is, in cases where maximal portability
       is of concern, replace:

           tteesstt eexxpprr11 --aa eexxpprr22

       with:

           tteesstt eexxpprr11 &&&& tteesstt eexxpprr22

       and replace:

           tteesstt eexxpprr11 --oo eexxpprr22

       with:

           tteesstt eexxpprr11 |||| tteesstt eexxpprr22

       but note that, in _t_e_s_t, --aa has higher precedence than --oo while ""&&&&"" and
       ""||||"" have equal precedence in the shell.

       Parentheses or braces can be used in the shell command language to
       effect grouping.

       Parentheses must be escaped when using _s_h; for example:

           tteesstt \\(( eexxpprr11 --aa eexxpprr22 \\)) --oo eexxpprr33

       This command is not always portable even on XSI-conformant systems
       depending on the expressions specified by _e_x_p_r1, _e_x_p_r2, and _e_x_p_r3.  The
       following form can be used instead:

           (( tteesstt eexxpprr11 &&&& tteesstt eexxpprr22 )) |||| tteesstt eexxpprr33

       The two commands:

           tteesstt ""$$11""
           tteesstt !! ""$$11""

       could not be used reliably on some historical systems. Unexpected
       results would occur if such a _s_t_r_i_n_g expression were used and $1
       expanded to ''!!'', ''(('', or a known unary primary. Better constructs are:

           tteesstt --nn ""$$11""
           tteesstt --zz ""$$11""

       respectively.

       Historical systems have also been unreliable given the common
       construct:

           tteesstt ""$$rreessppoonnssee"" == ""eexxppeecctteedd ssttrriinngg""

       One of the following is a more reliable form:

           tteesstt ""XX$$rreessppoonnssee"" == ""XXeexxppeecctteedd ssttrriinngg""
           tteesstt ""eexxppeecctteedd ssttrriinngg"" == ""$$rreessppoonnssee""

       Note that the second form assumes that _e_x_p_e_c_t_e_d _s_t_r_i_n_g could not be
       confused with any unary primary. If _e_x_p_e_c_t_e_d _s_t_r_i_n_g starts with ''--'',
       ''(('', ''!!'', or even ''=='', the first form should be used instead. Using the
       preceding rules without the XSI marked extensions, any of the three
       comparison forms is reliable, given any input. (However, note that the
       strings are quoted in all cases.)

       Because the string comparison binary primaries, ''=='' and ""!!=="", have a
       higher precedence than any unary primary in the greater than 4 argument
       case, unexpected results can occur if arguments are not properly
       prepared. For example, in:

           tteesstt --dd $$11 --oo --dd $$22

       If $1 evaluates to a possible directory name of ''=='', the first three
       arguments are considered a string comparison, which shall cause a
       syntax error when the second --dd is encountered. One of the following
       forms prevents this; the second is preferred:

           tteesstt \\(( --dd ""$$11"" \\)) --oo \\(( --dd ""$$22"" \\))
           tteesstt --dd ""$$11"" |||| tteesstt --dd ""$$22""

       Also in the greater than 4 argument case:

           tteesstt ""$$11"" == ""bbaatt"" --aa ""$$22"" == ""bbaallll""

       syntax errors occur if $1 evaluates to ''(('' or ''!!''.  One of the
       following forms prevents this; the third is preferred:

           tteesstt ""XX$$11"" == ""XXbbaatt"" --aa ""XX$$22"" == ""XXbbaallll""
           tteesstt ""$$11"" == ""bbaatt"" &&&& tteesstt ""$$22"" == ""bbaallll""
           tteesstt ""XX$$11"" == ""XXbbaatt"" &&&& tteesstt ""XX$$22"" == ""XXbbaallll""

EEXXAAMMPPLLEESS
        1. Exit if there are not two or three arguments (two variations):

               iiff [[ $$## --nnee 22 ]] &&&& [[ $$## --nnee 33 ]];; tthheenn eexxiitt 11;; ffii
               iiff [[ $$## --lltt 22 ]] |||| [[ $$## --ggtt 33 ]];; tthheenn eexxiitt 11;; ffii

        2. Perform a _m_k_d_i_r if a directory does not exist:

               tteesstt !! --dd tteemmppddiirr &&&& mmkkddiirr tteemmppddiirr

        3. Wait for a file to become non-readable:

               wwhhiillee tteesstt --rr tthheeffiillee
               ddoo
                   sslleeeepp 3300
               ddoonnee
               eecchhoo ''""tthheeffiillee"" iiss nnoo lloonnggeerr rreeaaddaabbllee''

        4. Perform a command if the argument is one of three strings (two
           variations):

               iiff [[ ""$$11"" == ""ppeeaarr"" ]] |||| [[ ""$$11"" == ""ggrraappee"" ]] |||| [[ ""$$11"" == ""aappppllee"" ]]
               tthheenn
                   _c_o_m_m_a_n_d
               ffii

               case "$1" in
                   pear|grape|apple) _c_o_m_m_a_n_d ;;
               esac

RRAATTIIOONNAALLEE
       The KornShell-derived conditional command (double bracket [[[[]]]]) was
       removed from the shell command language description in an early
       proposal. Objections were raised that the real problem is misuse of the
       _t_e_s_t command ([[), and putting it into the shell is the wrong way to fix
       the problem.  Instead, proper documentation and a new shell reserved
       word (!!)  are sufficient.

       Tests that require multiple _t_e_s_t operations can be done at the shell
       level using individual invocations of the _t_e_s_t command and shell
       logicals, rather than using the error-prone --oo flag of _t_e_s_t.

       XSI-conformant systems support more than four arguments.

       XSI-conformant systems support the combining of primaries with the
       following constructs:

       _e_x_p_r_e_s_s_i_o_n_1 --aa _e_x_p_r_e_s_s_i_o_n_2
             True if both _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are true.

       _e_x_p_r_e_s_s_i_o_n_1 --oo _e_x_p_r_e_s_s_i_o_n_2
             True if at least one of _e_x_p_r_e_s_s_i_o_n_1 and _e_x_p_r_e_s_s_i_o_n_2 are true.

       (( _e_x_p_r_e_s_s_i_o_n ))
             True if _e_x_p_r_e_s_s_i_o_n is true.

       In evaluating these more complex combined expressions, the following
       precedence rules are used:

        *  The unary primaries have higher precedence than the algebraic
           binary primaries.

        *  The unary primaries have lower precedence than the string binary
           primaries.

        *  The unary and binary primaries have higher precedence than the
           unary _s_t_r_i_n_g primary.

        *  The !!  operator has higher precedence than the --aa operator, and the
           --aa operator has higher precedence than the --oo operator.

        *  The --aa and --oo operators are left associative.

        *  The parentheses can be used to alter the normal precedence and
           associativity.

       The BSD and System V versions of --ff are not the same. The BSD
       definition was:

       --ff _f_i_l_e   True if _f_i_l_e exists and is not a directory.

       The SVID version (true if the file exists and is a regular file) was
       chosen for this volume of POSIX.1-2008 because its use is consistent
       with the --bb, --cc, --dd, and --pp operands (_f_i_l_e exists and is a specific
       file type).

       The --ee primary, possessing similar functionality to that provided by
       the C shell, was added because it provides the only way for a shell
       script to find out if a file exists without trying to open the file.
       Since implementations are allowed to add additional file types, a
       portable script cannot use:

           tteesstt --bb ffoooo --oo --cc ffoooo --oo --dd ffoooo --oo --ff ffoooo --oo --pp ffoooo

       to find out if ffoooo is an existing file. On historical BSD systems, the
       existence of a file could be determined by:

           tteesstt --ff ffoooo --oo --dd ffoooo

       but there was no easy way to determine that an existing file was a
       regular file. An early proposal used the KornShell --aa primary (with the
       same meaning), but this was changed to --ee because there were concerns
       about the high probability of humans confusing the --aa primary with the
       --aa binary operator.

       The following options were not included in this volume of POSIX.1-2008,
       although they are provided by some implementations. These operands
       should not be used by new implementations for other purposes:

       --kk _f_i_l_e   True if _f_i_l_e exists and its sticky bit is set.

       --CC _f_i_l_e   True if _f_i_l_e is a contiguous file.

       --VV _f_i_l_e   True if _f_i_l_e is a version file.

       The following option was not included because it was undocumented in
       most implementations, has been removed from some implementations
       (including System V), and the functionality is provided by the shell
       (see _S_e_c_t_i_o_n _2_._6_._2, _P_a_r_a_m_e_t_e_r _E_x_p_a_n_s_i_o_n.

       --ll _s_t_r_i_n_g The length of the string _s_t_r_i_n_g.

       The --bb, --cc, --gg, --pp, --uu, and --xx operands are derived from the SVID;
       historical BSD does not provide them. The --kk operand is derived from
       System V; historical BSD does not provide it.

       On historical BSD systems, _t_e_s_t --ww _d_i_r_e_c_t_o_r_y always returned false
       because _t_e_s_t tried to open the directory for writing, which always
       fails.

       Some additional primaries newly invented or from the KornShell appeared
       in an early proposal as part of the conditional command ([[[[]]]]): _s_1 >>
       _s_2, _s_1 << _s_2, _s_t_r == _p_a_t_t_e_r_n, _s_t_r !!== _p_a_t_t_e_r_n, _f_1 --nntt _f_2, _f_1 --oott _f_2, and
       _f_1 --eeff _f_2.  They were not carried forward into the _t_e_s_t utility when
       the conditional command was removed from the shell because they have
       not been included in the _t_e_s_t utility built into historical
       implementations of the _s_h utility.

       The --tt _f_i_l_e___d_e_s_c_r_i_p_t_o_r primary is shown with a mandatory argument
       because the grammar is ambiguous if it can be omitted. Historical
       implementations have allowed it to be omitted, providing a default of
       1.

       It is noted that ''[['' is not part of the portable filename character
       set; however, since it is required to be encoded by a single byte, and
       is part of the portable character set, the name of this utility forms a
       character string across all supported locales.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _1_._1_._1_._4, _F_i_l_e _R_e_a_d, _W_r_i_t_e, _a_n_d _C_r_e_a_t_i_o_n, _f_i_n_d

       The Base Definitions volume of POSIX.1-2008, _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, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) 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.unix.org/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                  2013                              TEST(1)
