home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 324.lha / Sweep / sweep.doc < prev    next >
Text File  |  1989-11-30  |  5KB  |  106 lines

  1. SWEEP is a CLI program which takes CLI commands and executes them in the
  2. current directory and in all directories below the current directory.
  3.  
  4.  * The directory tree can be traversed in a pre-order (top down) fashion,
  5.      or in a post-order (bottom up) fashion.  The latter is the default.
  6.  * Multiple commands can be issued in the same manner as with the RUN
  7.      command.
  8.  * Input and output can be redirected for SWEEP as well as for the
  9.      commands it executes.
  10.  
  11. The command syntax is:
  12.     SWEEP [+|-|?] cmd [+ <return> cmd] ...
  13.  
  14.     +   As the first character, '+' forces the directory tree to be
  15.         traversed in a post-order (bottom up) fashion.  This is the
  16.         default behavior, thus this parameter is useless.  In this mode,
  17.         the command(s) will be executed in the lowest-level directories
  18.         first.
  19.  
  20.     -   forces the directory tree to be traversed in a pre-order (top down)
  21.         fashion.  In this mode, the command(s) will be executed in the
  22.         current directory first, then in the lower-level subdirectories.
  23.  
  24.     ?   Causes the command syntax to be displayed.  In this case, any
  25.         command is ignored.
  26.  
  27. Some examples are in order.
  28.  
  29.     Assume we have a disk with the following directory structure:
  30.             Volume Name: MyDisk
  31.                                           (root)
  32.                                          /      \
  33.                                       Test     Real
  34.                                      /   \      /  \
  35.                                    A      Q    S    T
  36.                                  /   \
  37.                                 /     \
  38.                               B         F
  39.                             / | \     /   \
  40.                            C  D  E   G     H
  41.  
  42. SWEEP list           Assuming our current directory is A, the list
  43.                      command will be executed in the following
  44.                      directories: C D E B G H F A
  45.  
  46. SWEEP -list          Assuming our current directory is A, the list
  47.                      command will be executed in the following
  48.                      directories: A B C D E F G H
  49.  
  50. SWEEP s:spat protect #? -wed
  51.                      This command would execute the spat script in all
  52.                      the directories, making all the files and
  53.                      directories read-only.
  54.  
  55. SWEEP delete #?      With A as our current directory, this will delete
  56.                      all the files in C, then in D, then E, then
  57.                      go to B and delete all B's files, including
  58.                      the now-empty directories C, D, and E.  It
  59.                      then cleans out G, H, F (getting rid of the empty
  60.                      G and H directories there) and finally back
  61.                      to A to delete A's files and the two empty
  62.                      directories B and F.  Use with care!
  63.  
  64. SWEEP -delete #?     This command is just like the last one, but it
  65.                      would not delete the directories that were
  66.                      not empty from the start.  This is because the
  67.                      directory tree is traversed top-down.  The delete
  68.                      command in the A directory would remove all of A's
  69.                      files, but because neither B nor F is empty, those
  70.                      directories will remain.  All the files in and below
  71.                      A, however, would be deleted, just like the last
  72.                      example.
  73.  
  74. SWEEP >ram:EditMe -echo "*N" +
  75. cd +
  76. list
  77.                      Assume the F directory is our current directory.
  78.                      This command would execute the echo, cd, and
  79.                      list commands in each directory from the current
  80.                      directory on down, in top-down fashon, producing a
  81.                      file on RAM: called "EditMe" which could be printed
  82.                      to provide a reference of what was on the disk.
  83.                      It would look like this:
  84.  
  85. MyDisk:Test/A/F
  86. .info                         76 ----rwed 30-Oct-89 21:12:37
  87. G                            Dir ----rwed 15-Jul-89 15:27:56
  88. H                            Dir ----rwed 24-Oct-88 19:04:37
  89. SomeFile                     894 ----rwed 13-Aug-88 18:11:51
  90. AnotherFile                  370 ----rwed 13-Aug-88 18:11:55
  91. SomeFile.info                894 ----rwed 13-Aug-88 18:12:05
  92. 6 files - 2 directories - 9 blocks used
  93.  
  94.  
  95. MyDisk:Test/A/F/G
  96. .info                         16 ----rwed 24-Oct-88 19:48:47
  97. 1 file - 2 blocks used
  98.  
  99.  
  100. MyDisk:Test/A/F/H
  101. Directory "current directory" is empty
  102.  
  103.  
  104.  
  105.  
  106.