


TEST(1L)                                                 TEST(1L)


NNAAMMEE
       test - check file types and compare values

SSYYNNOOPPSSIISS
       tteesstt [expr]

DDEESSCCRRIIPPTTIIOONN
       This manual page documents the GNU version of tteesstt.

       tteesstt  returns  a status of 0 (true) or 1 (false) depending
       on the evaluation  of  the  conditional  expression  _e_x_p_r.
       Expressions may be unary or binary.  Unary expressions are
       often used to examine the status of  a  file.   There  are
       string operators and numeric comparison operators as well.

       --bb _f_i_l_e
              True if _f_i_l_e exists and is block special.
       --cc _f_i_l_e
              True if _f_i_l_e exists and is character special.
       --dd _f_i_l_e
              True if _f_i_l_e exists and is a directory.
       --ee _f_i_l_e
              True if _f_i_l_e exists
       --ff _f_i_l_e
              True if _f_i_l_e exists and is a regular file.
       --gg _f_i_l_e
              True if _f_i_l_e exists and is set-group-id.
       --kk _f_i_l_e
              True if _f_i_l_e has its ``sticky'' bit set.
       --LL _f_i_l_e
              True if _f_i_l_e exists and is a symbolic link.
       --pp _f_i_l_e
              True if _f_i_l_e exists and is a named pipe.
       --rr _f_i_l_e
              True if _f_i_l_e exists and is readable.
       --ss _f_i_l_e
              True if _f_i_l_e exists and has  a  size  greater  than
              zero.
       --SS _f_i_l_e
              True if _f_i_l_e exists and is a socket.
       --tt [[_f_d]]
              True if _f_d is opened on a terminal.  If _f_d is omit-
              ted, it defaults to 1 (standard output).
       --uu _f_i_l_e
              True if _f_i_l_e exists and its set-user-id bit is set.
       --ww _f_i_l_e
              True if _f_i_l_e exists and is writable.
       --xx _f_i_l_e
              True if _f_i_l_e exists and is executable.
       --OO _f_i_l_e
              True  if  _f_i_l_e exists and is owned by the effective
              user id.
       --GG _f_i_l_e
              True if _f_i_l_e exists and is owned by  the  effective



                                                                1





TEST(1L)                                                 TEST(1L)


              group id.
       _f_i_l_e_1 -nntt _f_i_l_e_2
              True  if  _f_i_l_e_1 is newer (according to modification
              date) than _f_i_l_e_2.
       _f_i_l_e_1 -oott _f_i_l_e_2
              True if _f_i_l_e_1 is older than file2.
       _f_i_l_e_1 --eeff _f_i_l_e
              True if _f_i_l_e_1 and _f_i_l_e_2 have the  same  device  and
              inode numbers.
       --zz _s_t_r_i_n_g
              True if the length of _s_t_r_i_n_g is zero.
       --nn _s_t_r_i_n_g
       _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is non-zero.
       _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2
              True if the strings are equal.
       _s_t_r_i_n_g_1 !!== _s_t_r_i_n_g_2
              True if the strings are not equal.
       !! _e_x_p_r True if _e_x_p_r is false.
       _e_x_p_r_1 -aa _e_x_p_r_2
              True if both _e_x_p_r_1 and _e_x_p_r_2 are true.
       _e_x_p_r_1 -oo _e_x_p_r_2
              True if either _e_x_p_r_1 or _e_x_p_r_2 is true.
       _a_r_g_1 OOPP _a_r_g_2
              OOPP  is  one  of  --eeqq,  --nnee,  --lltt, --llee, --ggtt, or --ggee.
              These arithmetic binary operators  return  true  if
              _a_r_g_1  is equal, not-equal, less-than, less-than-or-
              equal, greater-than, or greater-than-or-equal  than
              _a_r_g_2,  respectively.  _a_r_g_1 and _a_r_g_2 may be positive
              integers, negative integers, or the special expres-
              sion  --ll  _s_t_r_i_n_g,  which evaluates to the length of
              _s_t_r_i_n_g.


























                                                                2


