home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / dirutl / rm104.ark / RM.DOC < prev   
Encoding:
Text File  |  1987-02-16  |  4.6 KB  |  124 lines

  1.  
  2.              R M . C
  3.  
  4.  File deletion utility
  5.  
  6.  This routine is a file deletion program for the CP/M-80 environment that
  7.  operates more or less in the style of UNIX (tm of AT&T) "rm".  Unlike CP/M
  8.  "erase", multiple filenames can be specified, and each can be
  9.  regular-expression wildcarded.  Further, it defaults into a verbose mode,
  10.  and can be run in an interactive query mode.  The plain '-' option is for
  11.  use with filenames that start with a '-'.
  12.  
  13.   Usage: rm [-f] [-i] [-q] [-] [s:]filename [filename...]
  14.  
  15.             s: => Expand afn only with SYStem attribute files
  16.         -f => Delete files, even if read-only
  17.         -i => Interactive query before deleting each file
  18.         -q => Quiet mode
  19.         -  => Designates that filenames follow
  20.  
  21.  The distributed compiled version of this program used the M. Kersenbrock
  22.  version of croot.c where the filenames are Unix-like regular-expression
  23.  (ambiguous) filenames.  See the section below for details.
  24.  
  25.  The handling of "SYStem attribute" and "R/O" are those defined under
  26.  CP/M 3.0, although this program is also compatible with CP/M 2.2 .
  27.  
  28.  The compiled binary, when run under CP/M 3.0, will set the system
  29.  error-status upon error to that value handled by the CCP105 
  30.  CCP replacement for "make" reasons explained there (if you use CP/M 3.0
  31.  and haven't replaced your CCP with CCP105, then you're working
  32.  too hard!).  This program (and CCP105 also) is compiled for Z80 only!
  33.  
  34.  This program may be freely distributed for non-commercial purposes 
  35.  so long as notices are retained in their entirety.
  36.  
  37.  (C) Copyright 1987 by Michael D. Kersenbrock, Aloha, Oregon.  All rights
  38.  reserved.
  39.  
  40.         >>---------------------------<<
  41.  
  42. Note:  The following description is implemented as a much improved and fixed
  43.        version of "croot.c" over and above the enhanced version published in
  44.        Dr.  Dobbs' Journal.  I probably will make it available sometime as
  45.        "KROOTx.C" or some such.  (where 'x' currently is '5').  BTW, I am
  46.        referencing the Aztec II C compiler.
  47.  
  48.  
  49.  
  50. I.  Wildcarding is with UNIX-style wildcards (UNIX is a tm of AT&T).
  51.  
  52.     '*'   -  Matches any string of characters. '*' may be imbedded!
  53.  
  54.     '?'   -  Matches any single character, NOT including ' '.
  55.  
  56.     [x-y] -  Matches any character in range of x through y.
  57.       
  58.         [^x-y] - Matches any character NOT in range of x through y.
  59.  
  60.        [a,b,c] - Matches characters a,b,c
  61.  
  62.     '.'   -  Matches any period in the filename (like any other non-special
  63.              character).  The period in a CP/M filename is handled as if
  64.          if it were "really there". When the extension is blank the
  65.          filename is concidered to both have a "." and not to. Other-
  66.          wise the '.' in a filename is handled like UNIX-csh where it
  67.          is just another character in the filename.
  68.  
  69.  
  70.  
  71.     EXAMPLES:   f*.doc    matches fred.doc, free.doc, and fish.doc
  72.                     does NOT match freddoc
  73.  
  74.             f*d.*c    matches fred.doc and freed.pac, but
  75.                 does NOT match free.doc or fred.lbr
  76.  
  77.             *doc    matches fred.doc, xx.doc, doc, and freddoc
  78.  
  79.            [a-c]*    matches acorn.c, apple.nix, and amiga.yup
  80.                 but not ibmold.hat or portland.zoo
  81.  
  82.             cat.*    matches cat.jen and cat.grz 
  83.  
  84.  
  85. II.   The EXPANDED SYNTAX (on the command line) is:
  86.  
  87.            > stdout_redir - standard out redirected to file or device
  88.              >> stdout_redir - standard out redirected to append to file
  89.  
  90.           < stdin_redir  - standard input redirected from file or device
  91.  
  92.              2> stderr_redir - standard error redirected to file or device
  93.             2>> stderr_redir - standard out redirected to append to file
  94.  
  95.           "quoted arguement" - maintains string as a literal arguement
  96.                    including imbedded spaces and wildcard
  97.                    characters.
  98.  
  99.        | next_command_string - pipes stdout to stdin of next
  100.                           command.
  101.  
  102. III. Stdin_redir may have wild cards.  If the filename spec matches
  103.     multiple files, however, it will "nab" the first one !  This feature
  104.     focuses upon fewer-keystroke-typing where stdin file is unique.
  105.  
  106.  
  107. IV. Wildcarding will NOT expand any files that have the "SYSTEM" attribute
  108.     flag set (CP/M 3.0).  You can, of course, still explicitly type the
  109.     name of a system-file, or use the "s:" specifier.
  110.  
  111.     In a wild-carded-file-expression (only!) a system-attribute specifier
  112.     "s:"can be issued.  "s:*.com" specifies all system .com files, and
  113.     "s:b:fred.*" specifes all the system fred files on disk "b:".
  114.  
  115.  
  116. V.  Each wildcard expansion results in a SORTED list of matching
  117.     filenames.
  118.  
  119.  
  120.  
  121.                 -Michael D. Kersenbrock    2/1987
  122.                  Aloha, Oregon
  123.                  (USENET: ...!tektronix!copper!michaelk)
  124.