home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 345.lha / CmdSweep_v1.0 / CmdSweep.doc < prev    next >
Encoding:
Text File  |  1990-01-29  |  4.9 KB  |  123 lines

  1. CmdSweep.c
  2.  
  3. Author:   Bill DuPree (with thanks to Jeff Lydiatt for PatMatch.c)
  4. Language: Lattice C version 5.04
  5. Date:     January 16, 1990
  6. Version:  1.00
  7.  
  8. Usage:  CmdSweep [options] <starting_directory> "Command"
  9.  
  10. CmdSweep executes a given command in every subdirectory under the
  11. specified starting directory including the starting directory.  It
  12. can also be used to execute the command for every matching file
  13. encountered in the directory tree.  If the current directory is the
  14. desired starting directory, then it may be specified by coding the
  15. argument as "".
  16.  
  17. The "Command" argument specifies a template for the command you wish
  18. to execute.  A favorite application of mine is to check the contents
  19. of a diskette for viral infestations by using CmdSweep with the command
  20. template "kv *", i.e. the full entry on the command line is:
  21.  
  22.       CmdSweep df0: "kv *"
  23.  
  24. The command template may contain the escape sequences %p and %f.  These
  25. will be replaced with the current directory path and current file 
  26. respectively, in command generation.  If you need to use the % character
  27. in the command, then escape it with an additional % character.
  28.  
  29. The "-A" option will force CmdSweep to process directories (and files)
  30. in alphabetical order.  While this may cause a slight performance penalty,
  31. it is useful in that you have some indication of how much processing
  32. remains to be done by the visual inspection of the current directory
  33. and/or file name.
  34.  
  35. The use of the "-F" (Files) option will cause CmdSweep to execute the
  36. command for every file it encounters in the directory tree.  If coded
  37. as "-F=pattern"  then the command is executed only for files matching
  38. the AmigaDOS pattern.
  39.  
  40. Deferred execution may be had through the use of the "-S" (Script) option
  41. which will cause CmdSweep to generate an AmigaDOS script file.  This
  42. option is coded as "-S=script_file_name" where script_file_name is the
  43. name of the file to receive the list of script commands.  If coded as
  44. "-SE=script_file_name" then ECHO commands will be placed into the
  45. script to provide a visible progress report when executing the script.
  46.  
  47. You may use the "-X=pattern" (eXclude) option to exclude from 
  48. consideration all files that match the supplied AmigaDOS pattern.
  49.  
  50. The "-H" (Here) option will inhibit the directory tree traversal causing
  51. CmdSweep to operate only in the supplied directory.  None of its
  52. subdirectories will be entered.
  53.  
  54. To compile and link:
  55.  
  56.       lc -b -r -v CmdSweep.c
  57.       lc -b -r -v PatMatch.c
  58.       blink lib:c.o,CmdSweep.o,PatMatch.o to CmdSweep lib lib:lc.lib SD SC ND
  59.  
  60. Examples:
  61.  
  62. (1) To browse every C source and header file on a diskette in drive df1:
  63.  
  64.       CmdSweep -f=#?.((c)|(h)) df1: "More %f"
  65.  
  66. (2) To create a script file in RAM: to do the same as example one:
  67.  
  68.       CmdSweep -s=ram:Browse.Script -f=#?.((c)|(h)) df1: "More %f"
  69.  
  70. (3) To delete all files ending in the ".bak" extension on dh0:
  71.  
  72.       CmdSweep -f=#?.bak dh0: "delete %f"
  73.  or
  74.       CmdSweep dh0: "delete #?.bak"
  75.  
  76. (4) To rid a diskette in drive df1: from viruses using the public domain
  77.     KV program:
  78.  
  79.      CmdSweep df1: "kv *"
  80.  or
  81.      CmdSweep df1: "kv %p/"
  82.  or
  83.      CmdSweep -f df1: "kv %p/%f"
  84.  
  85. I'm sure that you will find many other uses.
  86.  
  87. --------------------------------------------------------------------------
  88. DISCLAIMER:
  89.  
  90. THIS PROGRAM AND ITS ASSOCIATED DOCUMENTATION ARE PROVIDED "AS IS"
  91. WITHOUT REPRESENTATION OR WARRANTY OF ANY KIND, EITHER EXPRESS OR
  92. IMPLIED, INCLUDING WITHOUT LIMITATION, ANY REPRESENTATIONS OR
  93. ENDORSEMENTS REGARDING THE USE OF, THE RESULTS OF, OR PERFORMANCE OF
  94. THE PROGRAM OR ITS ASSOCIATED DOCUMENTATION, ITS APPROPRIATENESS,
  95. ACCURACY, RELIABILTY, OR CURRENTNESS.  THE ENTIRE RISK AS TO THE USE OF
  96. THIS PROGRAM OR ITS ASSOCIATED DOCUMENTATION IS ASSUMED BY THE USER.
  97.  
  98. IN NO EVENT WILL BILL DUPREE, NOR ANY OTHER PARTY INVOLVED IN THE
  99. CREATION OR DISSEMINATION OF THIS PROGRAM AND ITS ASSOCIATED
  100. DOCUMENTATION, BE LIABLE FOR ANY DAMAGES, DIRECT, INDIRECT,
  101. INCIDENTAL OR CONSEQUENTIAL, RESULTING FROM ANY DEFECT IN THIS PROGRAM,
  102. EVEN IF ANY OF THE AFOREMENTIONED PARTIES HAS BEEN ADVISED OF THE
  103. POSSIBILITY OF SUCH DAMAGES.
  104.  
  105. THIS DISCLAIMER SHALL SUPERCEDE ANY VERBAL OR WRITTEN STATEMENT TO
  106. THE CONTRARY.
  107.  
  108. Enough of the CYA stuff already.  This program is hereby placed into the
  109. public domain.  Please use it freely for whatever purposes you deem
  110. necessary.  However, if you incorporate it into any wondrous creations
  111. of your own, give credit where credit is due, i.e. leave the names of
  112. the author(s) intact in the code.  We all want our moments in the sun.
  113. It would probably also be wise to continue including the disclaimer given
  114. the state of affairs in our litigious society.  If you feel compelled to
  115. contact me for any reason, or if you want to pass on constructive
  116. criticism, suggestions, ideas for new features, or monetary rewards
  117. (not necessary), or if you are a young, pretty, and single female Amiga
  118. enthusiast in the Chicagoland area (I'm single), you can contact me at:
  119.  
  120.       Bill DuPree
  121.       7449 W. Washington #402
  122.       Forest Park, IL. 60130
  123.