home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / futils / futils~1 / man / manpages.zoo / test.1 < prev    next >
Encoding:
Text File  |  1991-11-13  |  3.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TEST(1L)                                                 TEST(1L)
  5.  
  6.  
  7.  
  8. NAME
  9.      test - check file types and compare values
  10.  
  11. SYNOPSIS
  12.      test [expr]
  13.  
  14. DESCRIPTION
  15.      This manual page documents the GNU version of test.
  16.  
  17.      test returns a status of 0 (true) or 1 (false) depending on
  18.      the evaluation of the conditional expression _✓e_✓x_✓p_✓r.  Expres-
  19.      sions may be unary or binary.  Unary expressions are often
  20.      used to examine the status of a file.  There are string
  21.      operators and numeric comparison operators as well.
  22.  
  23.      -b _✓f_✓i_✓l_✓e
  24.           True if _✓f_✓i_✓l_✓e exists and is block special.
  25.      -c _✓f_✓i_✓l_✓e
  26.           True if _✓f_✓i_✓l_✓e exists and is character special.
  27.      -d _✓f_✓i_✓l_✓e
  28.           True if _✓f_✓i_✓l_✓e exists and is a directory.
  29.      -e _✓f_✓i_✓l_✓e
  30.           True if _✓f_✓i_✓l_✓e exists
  31.      -f _✓f_✓i_✓l_✓e
  32.           True if _✓f_✓i_✓l_✓e exists and is a regular file.
  33.      -g _✓f_✓i_✓l_✓e
  34.           True if _✓f_✓i_✓l_✓e exists and is set-group-id.
  35.      -k _✓f_✓i_✓l_✓e
  36.           True if _✓f_✓i_✓l_✓e has its ``sticky'' bit set.
  37.      -L _✓f_✓i_✓l_✓e
  38.           True if _✓f_✓i_✓l_✓e exists and is a symbolic link.
  39.      -p _✓f_✓i_✓l_✓e
  40.           True if _✓f_✓i_✓l_✓e exists and is a named pipe.
  41.      -r _✓f_✓i_✓l_✓e
  42.           True if _✓f_✓i_✓l_✓e exists and is readable.
  43.      -s _✓f_✓i_✓l_✓e
  44.           True if _✓f_✓i_✓l_✓e exists and has a size greater than zero.
  45.      -S _✓f_✓i_✓l_✓e
  46.           True if _✓f_✓i_✓l_✓e exists and is a socket.
  47.      -t [_✓f_✓d]
  48.           True if _✓f_✓d is opened on a terminal.  If _✓f_✓d is omitted,
  49.           it defaults to 1 (standard output).
  50.      -u _✓f_✓i_✓l_✓e
  51.           True if _✓f_✓i_✓l_✓e exists and its set-user-id bit is set.
  52.      -w _✓f_✓i_✓l_✓e
  53.           True if _✓f_✓i_✓l_✓e exists and is writable.
  54.      -x _✓f_✓i_✓l_✓e
  55.           True if _✓f_✓i_✓l_✓e exists and is executable.
  56.      -O _✓f_✓i_✓l_✓e
  57.           True if _✓f_✓i_✓l_✓e exists and is owned by the effective user
  58.           id.
  59.      -G _✓f_✓i_✓l_✓e
  60.  
  61.  
  62.  
  63. Page 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TEST(1L)                                                 TEST(1L)
  71.  
  72.  
  73.  
  74.           True if _✓f_✓i_✓l_✓e exists and is owned by the effective group
  75.           id.
  76.      _✓f_✓i_✓l_✓e_✓1 -nt _✓f_✓i_✓l_✓e_✓2
  77.           True if _✓f_✓i_✓l_✓e_✓1 is newer (according to modification date)
  78.           than _✓f_✓i_✓l_✓e_✓2.
  79.      _✓f_✓i_✓l_✓e_✓1 -ot _✓f_✓i_✓l_✓e_✓2
  80.           True if _✓f_✓i_✓l_✓e_✓1 is older than file2.
  81.      _✓f_✓i_✓l_✓e_✓1 -ef _✓f_✓i_✓l_✓e
  82.           True if _✓f_✓i_✓l_✓e_✓1 and _✓f_✓i_✓l_✓e_✓2 have the same device and inode
  83.           numbers.
  84.      -z _✓s_✓t_✓r_✓i_✓n_✓g
  85.           True if the length of _✓s_✓t_✓r_✓i_✓n_✓g is zero.
  86.      -n _✓s_✓t_✓r_✓i_✓n_✓g
  87.      _✓s_✓t_✓r_✓i_✓n_✓g
  88.           True if the length of _✓s_✓t_✓r_✓i_✓n_✓g is non-zero.
  89.      _✓s_✓t_✓r_✓i_✓n_✓g_✓1 = _✓s_✓t_✓r_✓i_✓n_✓g_✓2
  90.           True if the strings are equal.
  91.      _✓s_✓t_✓r_✓i_✓n_✓g_✓1 != _✓s_✓t_✓r_✓i_✓n_✓g_✓2
  92.           True if the strings are not equal.
  93.      ! _✓e_✓x_✓p_✓r
  94.           True if _✓e_✓x_✓p_✓r is false.
  95.      _✓e_✓x_✓p_✓r_✓1 -a _✓e_✓x_✓p_✓r_✓2
  96.           True if both _✓e_✓x_✓p_✓r_✓1 and _✓e_✓x_✓p_✓r_✓2 are true.
  97.      _✓e_✓x_✓p_✓r_✓1 -o _✓e_✓x_✓p_✓r_✓2
  98.           True if either _✓e_✓x_✓p_✓r_✓1 or _✓e_✓x_✓p_✓r_✓2 is true.
  99.      _✓a_✓r_✓g_✓1 OP _✓a_✓r_✓g_✓2
  100.           OP is one of -eq, -ne, -lt, -le, -gt, or -ge.  These
  101.           arithmetic binary operators return true if _✓a_✓r_✓g_✓1 is
  102.           equal, not-equal, less-than, less-than-or-equal,
  103.           greater-than, or greater-than-or-equal than _✓a_✓r_✓g_✓2,
  104.           respectively.  _✓a_✓r_✓g_✓1 and _✓a_✓r_✓g_✓2 may be positive integers,
  105.           negative integers, or the special expression -l _✓s_✓t_✓r_✓i_✓n_✓g,
  106.           which evaluates to the length of _✓s_✓t_✓r_✓i_✓n_✓g.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Page 2
  130.  
  131.  
  132.  
  133.