home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / doc / test.man < prev    next >
Text File  |  1993-06-13  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. TEST(1)                                                   TEST(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        test - test condition (Korn and 8th edition)
  9.  
  10. SSYYNNOOPPSSIISS
  11.        tteesstt _e_x_p_r_e_s_s_i_o_n
  12.        [[ _e_x_p_r_e_s_s_i_o_n ]]
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.        TTeesstteevvaalluuaatteess  tthhee  _e_x_p_r_e_s_s_i_o_n  aanndd rreettuurrnnss zzeerroo ssttaattuuss iiff
  16.        ttrruuee,, aanndd nnoonn--zzeerroo ssttaattuuss ootthheerrwwiissee..  IItt iiss nnoorrmmaallllyy  uusseedd
  17.        aass tthhee ccoonnttrroolllliinngg ccoommmmaanndd ooff tthhee iiff aanndd wwhhiillee ssttaatteemmeennttss..
  18.  
  19.        The following basic expressions are available.
  20.  
  21.               -r file                       file  exists  and  is
  22.               readable
  23.               -w  file                       file  exists  and is
  24.               writable
  25.               -x file                       file  exists  and  is
  26.               executable
  27.               -f  file                       file  is  a  regular
  28.               file
  29.               -d file                       file is a directory
  30.               -c file                       file is  a  character
  31.               special device
  32.               -b  file                       file is a block spe-
  33.               cial device
  34.               -p file                       file is a named pipe
  35.               -u file                       file mode has  setuid
  36.               bit
  37.               -g  file                       file mode has setgid
  38.               bit
  39.               -k file                       file mode has  sticky
  40.               bit
  41.               -s file                       file is not empty
  42.               -L  file                       file  is  a symbolic
  43.               link
  44.               -S file                       file is a socket
  45.               file -nt file                 first file  is  newer
  46.               than second file
  47.               file  -ot  file                 first file is older
  48.               than second file
  49.               file -ef  file                 first  file  is  the
  50.               same file as second
  51.               -t  filedes                    file descriptor is a
  52.               tty device
  53.  
  54.               string                        string is not null
  55.               -z string                     string is null
  56.               -n string                     string is not null
  57.               string = string               strings are equal
  58.               string != string              strings are not equal
  59.  
  60.               number -eq number             numbers compare equal
  61.  
  62.  
  63.  
  64. Korn shell                 January 1988                         1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TEST(1)                                                   TEST(1)
  71.  
  72.  
  73.               number -ne number             numbers  compare  not
  74.               equal
  75.               number   -ge   number             numbers   compare
  76.               greater than or equal
  77.               number   -gt   number             numbers   compare
  78.               greater than
  79.               number  -le number             numbers compare less
  80.               than or equal
  81.               number -lt number             numbers compare  less
  82.               than
  83.  
  84.        The  above basic expressions may be combined with the fol-
  85.        lowing operators.
  86.  
  87.               expr -o expr                  logical or
  88.               expr -a expr                  logical and
  89.               ! expr                        logical not
  90.               ( expr )                      grouping
  91.  
  92. AAUUTTHHOORR
  93.        Erik Baalbergen. Modified by Arnold Robbins.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. Korn shell                 January 1988                         2
  131.  
  132.  
  133.