home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / dirutl / whereis.arc / READ.ME next >
Encoding:
Text File  |  1988-05-14  |  17.7 KB  |  471 lines

  1.     May 1, 1988
  2.     
  3.     WHEREIS Copyright Kenneth R. Waletzki 1988
  4.     
  5.     If you use this program, you MUST pay $20 for a license to use it
  6.     (see the LICENSE STATEMENT later in this document).
  7.     
  8.     Send $20 to
  9.     
  10.         Handmade Software
  11.         4141 Ball Road, #240
  12.         Cypress, CA 90630-3465
  13.  
  14.  
  15.     ----------------------------------------------------------------------
  16.     
  17.     This document describes the program WHEREIS.  There are several
  18.     versions of the WHEREIS program distributed on the BBSs; however,
  19.     this one does it all.
  20.     
  21.     This version of WHEREIS will operate the same way as the original
  22.     version; i.e.,
  23.     
  24.             WHEREIS *.ARC
  25.     
  26.     This will display all the files on the current logged drive that
  27.     match the search criteria.
  28.     
  29.     This version of WHEREIS maintains the above usage as well as an
  30.     extended usage.  If the extended usage is used, you must use the
  31.     proper parameters to describe the search criteria.
  32.     
  33.     WHEREIS version 6.2 contains the following command line options:
  34.     
  35.             WHEREIS searchname | -adfhnorstxD
  36.     
  37.     This means you can enter the searchname by itself, (WHEREIS *.ARC),
  38.     or you can use the extended option set.
  39.     
  40.     Here is a brief description of each option:
  41.     
  42.             -a  Archive bit
  43.             -d  Directory
  44.             -f  File which contains \"whereis\" switches
  45.             -h  Hidden file
  46.             -n  Name of file or wildcard: i.e., -n tmp.dat, or -n *.o, etc.
  47.             -o  Output data to filename: i.e., -o output.txt
  48.             -r  Read Only bit
  49.             -s  Size of file: i.e., -s 1000, to find files >= 1000 bytes
  50.             -t  Totals: provides statistics on files on disk
  51.             -x  eXecute a PROGRAM using FOUND file name as a parameter
  52.             -D  Date: i.e, -D 022988
  53.     
  54.             NOTE:  The option switches are CASE sensitive; i.e. -d is
  55.             different from -D.
  56.     
  57.     So, with the extended search switches you can do the simple 
  58.     
  59.             WHEREIS *.ARC
  60.     
  61.     like this in the extended mode
  62.     
  63.             WHEREIS -n *.arc
  64.     
  65.     Since the command line switches are CASE sensitive, entering
  66.     
  67.             WHEREIS -N *.ARC
  68.     
  69.     will produce an error message.  Options must be given in the case
  70.     they are displayed.
  71.     
  72.     
  73.     The extended set of switches will allow you to do MANY more
  74.     specialized searches and special things on the results of a search. 
  75.     For example to search the entire disk for "*.arc" which is READ ONLY,
  76.     you would enter:
  77.     
  78.             whereis -r -n *.arc
  79.     
  80.     This would produce a list of all *.ARC files on the disk that are
  81.     read  only.  
  82.     
  83.     You could do the same command, but for files that are equal to the
  84.     "\usr" directory or its subdirectories:
  85.     
  86.             whereis \usr -r -n *.arc
  87.     
  88.     This would NOT search the entire disk, but only from the directory
  89.     "\usr" and those underneath it.
  90.     
  91.     ----------------------------------------------------------------------
  92.     
  93.     EXAMPLE USES FOR THE NEW WHEREIS PROGRAM:
  94.     
  95.     (1)
  96.     whereis \usr -n *.arc -x "echo %p >>out" -x "arc -v %f >>out"
  97.     
  98.             Find all "arc" files and echo the full path/filename to a
  99.             file called "out".  Then display the contents of the archive
  100.             file to the file "out".
  101.     
  102.     
  103.     (2)
  104.     whereis -n *.txt *.me *.doc -x "grep Speilberg %p" -o nul
  105.     
  106.             This example will find files that end in a ".txt", ".me", or
  107.             ".doc" extension.  When it has found a match it will run the 
  108.             program "grep" to search for the word "Speilberg" in the
  109.             file found and will print it to the standard output device.  
  110.             All filenames that are found will not be printed to the
  111.             screen, but will be sent to the NUL device.
  112.     
  113.     
  114.     (3)
  115.     whereis \usr -f csearch.dat
  116.     
  117.             This example will begin its search at the "\usr" directory
  118.             and will use the parameters from the file csearch.dat to 
  119.             find files that match the search criteria.
  120.     
  121.             Say the file csearch.dat contained the following text:
  122.     
  123.             -D 030188
  124.             -n *.c
  125.             -n *.h
  126.             -x "findfunc xstrncmp %p"
  127.             -x "print %p"
  128.     
  129.     
  130.             This would cause whereis to search for files that have a date
  131.             equal to or greater than 030188; and the file must be a ".c"
  132.             or a ".h".  when the file is found the program "findfunc" 
  133.             will be executed followed by the program "print"
  134.     
  135.     
  136.     (4)
  137.     whereis \usr -f updatec.dat
  138.     
  139.             update.dat contains:
  140.     
  141.                 -a
  142.                 -o update.lst
  143.                 -n *.c
  144.                 -n *.h
  145.                 -n *.mak
  146.                 -x "attrib -r sources.arc"
  147.                 -x "arc a sources %f"
  148.                 -x "attrib +r sources.arc"
  149.                 -x "attrib -a %f"
  150.     
  151.             This search would find all ".c", ".h", and ".mak" files that
  152.             have the archive bit set.  When it found a match it would
  153.             change the attribute on the sources.arc file to allow read/
  154.             write access; then the found file will be added to the 
  155.             sources.arc archive file; then the sources.arc file will be
  156.             set to read only mode; and finally, the archive bit on the
  157.             file found will be turned off.
  158.     
  159.     ======================================================================
  160.     
  161.                               TECHNICAL REFERENCE
  162.     
  163.     ----------------------------------------------------------------------
  164.     COMMAND:    -a
  165.     
  166.     PURPOSE:    To select files that have the ARCHIVE bit on
  167.     
  168.     EXAMPLE:    whereis -a
  169.     
  170.                 This would search the entire disk for all files that have
  171.                 the archive bit on. 
  172.     
  173.     
  174.     ----------------------------------------------------------------------
  175.     COMMAND:    -d
  176.     
  177.     PURPOSE:    To select only directories
  178.     
  179.     EXAMPLE:    whereis -d
  180.      
  181.                 This would search the entire disk for sub-directories
  182.     
  183.     
  184.     ----------------------------------------------------------------------
  185.     COMMAND:    -f filename
  186.     
  187.     PURPOSE:    To include a filename that has whereis switches in it.
  188.     
  189.     EXAMPLE:    whereis -f whereis.dat
  190.     
  191.                 This would cause the whereis program to look in the file
  192.                 specified for switches as well as the command line.
  193.                  
  194.                 So, if the file WHEREIS.DAT included the following:
  195.     
  196.                 -r
  197.                 -n *.TXT
  198.                 -n *.DOC
  199.                 -n *.me
  200.                   
  201.                 This would be the same as the command line version:
  202.     
  203.                 whereis -r -n *.txt -n *.doc -n *.me
  204.     
  205.     
  206.     ----------------------------------------------------------------------
  207.     COMMAND:    -h
  208.     
  209.     PURPOSE:    This will cause WHEREIS to look for files that have the
  210.                 hidden file bit on.
  211.     
  212.     EXAMPLE:    whereis -h
  213.     
  214.                 This would cause whereis to search the entire disk for
  215.                 all files that are "hidden".
  216.     
  217.     
  218.     ----------------------------------------------------------------------
  219.     COMMAND:    -n filename
  220.     
  221.     PURPOSE:    This is to specify the filename or wildcard search to
  222.                 perform.
  223.     
  224.     EXAMPLE:    whereis -n *.txt
  225.     
  226.                 This would cause WHEREIS to search the entire disk for
  227.                 all files that have a ".txt" extension.
  228.     
  229.                 Several "-n filename" may be use on the command line or
  230.                 included in the "switch file" (see the -f option above).
  231.     
  232.                 If you wanted to find all files that have the ".obj",
  233.                 ".c" and the ".exe" extensions, you could tell whereis
  234.                 three times:
  235.     
  236.                    whereis -n *.obj
  237.                    whereis -n *.c
  238.                    whereis -n *.exe
  239.     
  240.                 or you could put all three name searches on the same
  241.                 line:
  242.     
  243.                    whereis -n *.obj -n *.c -n *.exe
  244.     
  245.     
  246.     ----------------------------------------------------------------------
  247.     COMMAND:    -o filename
  248.     
  249.     PURPOSE:    This option redirects the files found from the stdout
  250.                 (terminal) to a filename specified.
  251.     
  252.     EXAMPLE:    whereis -n *.arc -o output.tmp
  253.     
  254.                 This would cause the output that would normally go to the
  255.                 screen; to go to the filename output.tmp
  256.     
  257.     
  258.     ----------------------------------------------------------------------
  259.     COMMAND:    -r
  260.     
  261.     PURPOSE:    This will cause whereis to include files that have the
  262.                 read only bit set.
  263.     
  264.     EXAMPLE:    whereis -n *.txt -r
  265.     
  266.                 This will find all files on the logged device that end in
  267.                 the extension ".txt" and that have their read-only bit
  268.                 set.
  269.     
  270.     
  271.     ----------------------------------------------------------------------
  272.     COMMAND:    -s number
  273.     
  274.     PURPOSE:    This will cause whereis to include files that have a size
  275.                 equal to or greater than the number given as a parameter.
  276.     
  277.     EXAMPLE:    whereis -n *.arc -s 200000
  278.     
  279.                 This will command whereis to find all ".arc" files that
  280.                 have a size of 200K bytes or more.
  281.                
  282.     
  283.     ----------------------------------------------------------------------
  284.     COMMAND:    -t
  285.     
  286.     PURPOSE:    This option will command whereis to provide some simple
  287.                 statistics on the search it just completed.
  288.     
  289.     EXAMPLE:    whereis \etc -a -r -n *.arc -t
  290.     
  291.                                     WHEREIS SEARCH TOTALS
  292.     
  293.                                  Files on disk: 643       
  294.                                 Bytes in files: 11564176  
  295.                                   Hidden files: 0         
  296.                                   Archive files: 191       
  297.                                Read only files: 3         
  298.     
  299.                      Files that matched search: 24        
  300.             Bytes in files that matched search: 1239835   
  301.     
  302.     
  303.     ----------------------------------------------------------------------
  304.     COMMAND:    -x "command string"
  305.     
  306.     OPTIONS:    %f -- filename, ie, doofus.txt
  307.                 %p -- pathname, ie, C:\USR\TEST\DOOFUS.TXT
  308.     
  309.     PURPOSE:    This option will cause whereis to eXecute the program or
  310.                 the dos function inside the command string.
  311.     
  312.     EXAMPLE:    whereis -n *.txt -x "print %f"
  313.     
  314.                 In this example, the command options instruct the whereis
  315.                 program to find all files on the logged disk device that
  316.                 ends in the ".txt" extension.  When the file is found,
  317.                 the command "print filename" will be executed.
  318.     
  319.                 Say, for example, that the whereis found the filename 
  320.                 "foobar.txt".  The command option, -x "print %f",
  321.                 instructs the whereis program to replace the %f with the 
  322.                 filename that it found.  So, the string "print %f" would
  323.                 be expanded to "print foobar.txt".  
  324.     
  325.                 Once the filename has been expanded, the execution
  326.                 string "print foobar.txt" would be instructed to be 
  327.                 executed.
  328.     
  329.                 There is no limit on what programs can be run or what
  330.                 they do.  Although it is advised, that they do not 
  331.                 remove directories; as this could disturb the normal
  332.                 operation of the whereis program.
  333.     
  334.                 This option as well as the name (see -n above) option can
  335.                 be stacked.  This means you can use more than one -x
  336.                 option on a command line (or in a -f file -- see above).
  337.     
  338.                 Example:
  339.     
  340.                   whereis -n *.txt -x "copy %f c:" -x "del %p"
  341.     
  342.                 This command line above will search the entire logged
  343.                 device for all files that end with the extension 
  344.                 ".ext".  When the whereis programs finds a match it 
  345.                 will perform each "-x" command in the order they
  346.                 appear on the command line (or in the whereis data file
  347.                 -- see the -f option above).  So, in this example, 
  348.                 after it has found a match it will cause the first
  349.                 "-x" command to be run; this will copy the matched file
  350.                 to the c: drive.  Then it will delete the file using
  351.                 the full pathname found.
  352.     
  353.     
  354.     ----------------------------------------------------------------------
  355.     COMMAND:    -D MMDDYY
  356.     
  357.     PURPOSE:    This command option will cause whereis to search for
  358.                 files whose date is equal to or greater than the date
  359.                 given as the required parameter to this option.
  360.     
  361.     EXAMPLE:    whereis -D 050188
  362.     
  363.                 This example will cause whereis to search the entire disk
  364.                 for all files that have a date equal to or greater than
  365.                 May 1, 1988 (050188).
  366.     
  367.     
  368.     ======================================================================
  369.     
  370.     You can use any or all of the command line options in a whereis
  371.     search.  Each option presented on the command line, or in a command
  372.     file, or both; is evaluated if the previous command option was
  373.     successful.  All options must be true, if the search is successful.
  374.     
  375.     Example:
  376.     
  377.             whereis -a -r -n *.arc -x "arc -v %f"
  378.     
  379.     In the above example, if the file the whereis program is examining
  380.     has the archive bit set, it will then examine the file to see if it
  381.     has the read-only bit set.  If it doesn't then the search proceeds to
  382.     the next file. 
  383.     
  384.     So, in the above example, if a file HAS the ARCHIVE bit SET, and it
  385.     has its READ-ONLY bit SET, and the file ends in an ".arc" extension,
  386.     the pathname will be printed to the standard output and the command
  387.     in the "-x" string will be executed.
  388.     
  389.     ======================================================================
  390.     
  391.     LICENSE STATEMENT
  392.     ------------------
  393.  
  394.     Handmade Software and Kenneth R. Waletzki are the sole owners of this
  395.     software.  This software is protected by both United States copyright 
  396.     law and international treaty provisions.  Use of this software is 
  397.     allowed only if you have mailed a $20 payment to Handmade Software,
  398.     4141 Ball Road, #240, Cypress, California, 90630-3465.  Only by
  399.     paying the fee and registering your name with Handmade Software are 
  400.     you considered a legal user of this program.
  401.  
  402.     This software is just like a book, with the following single exception. 
  403.     Handmade Software authorizes you to make archival copies of the
  404.     software for the sole purpose of backing-up our software and
  405.     protecting your investment from loss.
  406.     
  407.     You may use this software on more than one computer, if you pay $20 for
  408.     each instance of this software on each computer.  For example, if
  409.     your company has 10 computers and this program is on each one of them,
  410.     you must register for 10 copies of this program ($200).
  411.  
  412.     Quantity Discount Schedule:
  413.  
  414.         Quantity    Cost Each
  415.         -------------------------
  416.         1 - 10      $20 each
  417.         11 - 50     $16 each
  418.         51 - 100    $13 each
  419.         over 100    $11 each
  420.  
  421.                                 DISTRIBUTION
  422.  
  423.     Handmade Software will allow you to distribute this software to any
  424.     individual or company, and we encourage you to do so.  However,
  425.     you cannot charge any monetary fee for doing so, unless you contact
  426.     Handmade Software and we authorize you to do so in writing.  If
  427.     you distribute this program, you must also include this document in
  428.     an unmodified and original format.
  429.  
  430.     
  431.                                   WARRANTY
  432.     
  433.     No warranty at all is implied.  Use of this software is "as-is".
  434.     This warranty shall not encompass any damages, including but not
  435.     limited to loss of profit, and special, incidental, consequential or
  436.     similar claims.
  437.     
  438.     Handmade Software specifically disclaims all other warranties,
  439.     expressed or implied, including but not limited to implied warranties
  440.     of merchantability and fitness for a particular purpose with respect
  441.     to defects in the diskette and documentation, and the program license
  442.     granted herein in particular, and without limiting operation of the
  443.     program license with respect to any particular application, use, or
  444.     purpose.  In no event shall Handmade Software be liable for any loss
  445.     of profit or any other commercial damage, including but not limited
  446.     to special, incidental, consequential or other damages.
  447.     
  448.                                    GOVERNING LAW
  449.     
  450.     This statement shall be construed, interpreted, and governed by the
  451.     laws of the State of California.
  452.     
  453.     ----------------------------------------------------------------------
  454.     
  455.     
  456.     
  457.     Become one of the many supporters of shareware software.  If you like
  458.     this program, use it, give it to your friends (please include this
  459.     document when you distribute it), and send your $20 to become a
  460.     registered user!
  461.     
  462.     Encourage the shareware process! Register today!
  463.     
  464.             Sincerely, 
  465.     
  466.             Kenneth R. Waletzki
  467.             Handmade Software
  468.             4141 Ball Road, #240
  469.             Cypress, CA 90630-3465
  470.  
  471.