


      TTTTEEEESSSSTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    TTTTEEEESSSSTTTT((((1111))))



      NNNNAAAAMMMMEEEE
           test - condition evaluation command

      SSSSYYYYNNNNTTTTAAAAXXXX
           tttteeeesssstttt expr
           [[[[ expr ]]]]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _T_e_s_t evaluates the expression _e_x_p_r and, if its value is
           true, returns a zero (true) exit status; otherwise, a non-
           zero (false) exit status is returned; _t_e_s_t also returns a
           non-zero exit status if there are no arguments.  The
           following primitives are used to construct _e_x_p_r:

           ----rrrr _f_i_l_e     true if _f_i_l_e exists and is readable.

           ----wwww _f_i_l_e     true if _f_i_l_e exists and is writable.

           ----xxxx _f_i_l_e     true if _f_i_l_e exists and is executable.

           ----ffff _f_i_l_e     true if _f_i_l_e exists and is a regular file.

           ----dddd _f_i_l_e     true if _f_i_l_e exists and is a directory.

           ----cccc _f_i_l_e     true if _f_i_l_e exists and is a character special
                       file.

           ----bbbb _f_i_l_e     true if _f_i_l_e exists and is a block special file.

           ----pppp _f_i_l_e     true if _f_i_l_e exists and is a named pipe (fifo).

           ----uuuu _f_i_l_e     true if _f_i_l_e exists and its set-user-ID bit is
                       set.

           ----gggg _f_i_l_e     true if _f_i_l_e exists and its set-group-ID bit is
                       set.

           ----kkkk _f_i_l_e     true if _f_i_l_e exists and its sticky bit is set.

           ----ssss _f_i_l_e     true if _f_i_l_e exists and has a size greater than
                       zero.

           ----tttt [ _f_i_l_d_e_s ]
                       true if the open file whose file descriptor
                       number is _f_i_l_d_e_s (1 by default) is associated
                       with a terminal device.

           ----zzzz _s_1       true if the length of string _s_1 is zero.

           ----nnnn _s_1       true if the length of the string _s_1 is non-zero.

           _s_1 ==== _s_2     true if strings _s_1 and _s_2 are identical.



      Page 1                                                   (9010-E)






      TTTTEEEESSSSTTTT((((1111))))                     ((((UUUUNNNNIIIIXXXX 5555....0000))))                    TTTTEEEESSSSTTTT((((1111))))



           _s_1 !!!!==== _s_2    true if strings _s_1 and _s_2 are _n_o_t identical.

           _s_1          true if _s_1 is _n_o_t the null string.

           _n_1 ----eeeeqqqq _n_2   true if the integers _n_1 and _n_2 are algebraically
                       equal.  Any of the comparisons ----nnnneeee, ----ggggtttt, ----ggggeeee,
                       ----lllltttt, and ----lllleeee may be used in place of ----eeeeqqqq.

           These primaries may be combined with the following
           operators:

           !!!!           unary negation operator.

           ----aaaa          binary _a_n_d operator.

           ----oooo          binary _o_r operator (----aaaa has higher precedence
                       than ----oooo).

           (((( expr ))))    parentheses for grouping.

           Notice that all the operators and flags are separate
           arguments to _t_e_s_t.  Notice also that parentheses are
           meaningful to the shell and, therefore, must be escaped.

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           find(1), sh(1).

      WWWWAAAARRRRNNNNIIIINNNNGGGG
           In the second form of the command (i.e., the one that uses
           [[[[]]]], rather than the word _t_e_s_t), the square brackets must be
           delimited by blanks.
























      Page 2                                                   (9010-E)



