home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource3 / 121_01 / if.doc < prev    next >
Encoding:
Text File  |  1985-08-21  |  2.3 KB  |  68 lines

  1.  
  2.  
  3.      IF (1)                    BDS C Users' Group                    IF (1)
  4.  
  5.  
  6.  
  7.  
  8.      NAME   
  9.      NAME 
  10.           if - conditionally execute programs 
  11.  
  12.  
  13.      SYNOPSIS   
  14.      SYNOPSIS 
  15.           if                                      
  16.           if <condition> command arg1 arg2 ...  
  17.  
  18.  
  19.      DESCRIPTION   
  20.      DESCRIPTION 
  21.           __                                                          
  22.           If is a program which executes any other program (passing 
  23.           command line arguments if specified) when a conditional test 
  24.           is met.  
  25.  
  26.  
  27.           The following conditions may be tested:
  28.           _________               ____ ___  
  29.           Condition               When met
  30.           -r filename             filename is readable, i.e. exists
  31.           -w filename             filename is writeable, i.e. not marked R/O
  32.           !(-r) filename          filename is not readable, i.e. does not exist
  33.           !(-w) filename          filename is not writeable, i.e. is marked R/O
  34.           str1 == str2            string 'str1' is the same as string 'str2'
  35.           str1 != str2            string 'str1' is different from string 'str2'
  36.  
  37.  
  38.      CAVEATS   
  39.      CAVEATS 
  40.           This program was tested with v1.50 of the BDS C compiler 
  41.           under CP/M 2.2.  It should work with other versions of BDS C 
  42.           and CP/M, but has not been tested.  
  43.  
  44.  
  45.      EXAMPLES   
  46.      EXAMPLES 
  47.           if -r a:data pip b:=a:data    if file 'a:data' exists, use pip to
  48.                                         copy it to drive B
  49.           if $1 == link clink $2 -n     if this is a line in a submit file
  50.                                         'test.sub', then:
  51.                                         'submit test link abc' will clink abc
  52.                                         'submit test lunk abc' won't clink abc
  53.  
  54.  
  55.      SEE ALSO   
  56.      SEE ALSO 
  57.           sh(1) 
  58.  
  59.  
  60.      BUGS   
  61.      BUGS 
  62.           You can't run any of the builtin commands (DIR, ERA, REN, 
  63.                                  __     
  64.           SAVE, TYPE, USER) from if.  
  65.  
  66.  
  67.      NOTES   
  68.      NOTES 
  69.           Requires local.c for link.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.                                       -1-
  89.  
  90.  
  91.           This program was tested with v1.50 of the BDS C compiler 
  92.