home *** CD-ROM | disk | FTP | other *** search
- May 1, 1988
-
- WHEREIS Copyright Kenneth R. Waletzki 1988
-
- If you use this program, you MUST pay $20 for a license to use it
- (see the LICENSE STATEMENT later in this document).
-
- Send $20 to
-
- Handmade Software
- 4141 Ball Road, #240
- Cypress, CA 90630-3465
-
-
- ----------------------------------------------------------------------
-
- This document describes the program WHEREIS. There are several
- versions of the WHEREIS program distributed on the BBSs; however,
- this one does it all.
-
- This version of WHEREIS will operate the same way as the original
- version; i.e.,
-
- WHEREIS *.ARC
-
- This will display all the files on the current logged drive that
- match the search criteria.
-
- This version of WHEREIS maintains the above usage as well as an
- extended usage. If the extended usage is used, you must use the
- proper parameters to describe the search criteria.
-
- WHEREIS version 6.2 contains the following command line options:
-
- WHEREIS searchname | -adfhnorstxD
-
- This means you can enter the searchname by itself, (WHEREIS *.ARC),
- or you can use the extended option set.
-
- Here is a brief description of each option:
-
- -a Archive bit
- -d Directory
- -f File which contains \"whereis\" switches
- -h Hidden file
- -n Name of file or wildcard: i.e., -n tmp.dat, or -n *.o, etc.
- -o Output data to filename: i.e., -o output.txt
- -r Read Only bit
- -s Size of file: i.e., -s 1000, to find files >= 1000 bytes
- -t Totals: provides statistics on files on disk
- -x eXecute a PROGRAM using FOUND file name as a parameter
- -D Date: i.e, -D 022988
-
- NOTE: The option switches are CASE sensitive; i.e. -d is
- different from -D.
-
- So, with the extended search switches you can do the simple
-
- WHEREIS *.ARC
-
- like this in the extended mode
-
- WHEREIS -n *.arc
-
- Since the command line switches are CASE sensitive, entering
-
- WHEREIS -N *.ARC
-
- will produce an error message. Options must be given in the case
- they are displayed.
-
-
- The extended set of switches will allow you to do MANY more
- specialized searches and special things on the results of a search.
- For example to search the entire disk for "*.arc" which is READ ONLY,
- you would enter:
-
- whereis -r -n *.arc
-
- This would produce a list of all *.ARC files on the disk that are
- read only.
-
- You could do the same command, but for files that are equal to the
- "\usr" directory or its subdirectories:
-
- whereis \usr -r -n *.arc
-
- This would NOT search the entire disk, but only from the directory
- "\usr" and those underneath it.
-
- ----------------------------------------------------------------------
-
- EXAMPLE USES FOR THE NEW WHEREIS PROGRAM:
-
- (1)
- whereis \usr -n *.arc -x "echo %p >>out" -x "arc -v %f >>out"
-
- Find all "arc" files and echo the full path/filename to a
- file called "out". Then display the contents of the archive
- file to the file "out".
-
-
- (2)
- whereis -n *.txt *.me *.doc -x "grep Speilberg %p" -o nul
-
- This example will find files that end in a ".txt", ".me", or
- ".doc" extension. When it has found a match it will run the
- program "grep" to search for the word "Speilberg" in the
- file found and will print it to the standard output device.
- All filenames that are found will not be printed to the
- screen, but will be sent to the NUL device.
-
-
- (3)
- whereis \usr -f csearch.dat
-
- This example will begin its search at the "\usr" directory
- and will use the parameters from the file csearch.dat to
- find files that match the search criteria.
-
- Say the file csearch.dat contained the following text:
-
- -D 030188
- -n *.c
- -n *.h
- -x "findfunc xstrncmp %p"
- -x "print %p"
-
-
- This would cause whereis to search for files that have a date
- equal to or greater than 030188; and the file must be a ".c"
- or a ".h". when the file is found the program "findfunc"
- will be executed followed by the program "print"
-
-
- (4)
- whereis \usr -f updatec.dat
-
- update.dat contains:
-
- -a
- -o update.lst
- -n *.c
- -n *.h
- -n *.mak
- -x "attrib -r sources.arc"
- -x "arc a sources %f"
- -x "attrib +r sources.arc"
- -x "attrib -a %f"
-
- This search would find all ".c", ".h", and ".mak" files that
- have the archive bit set. When it found a match it would
- change the attribute on the sources.arc file to allow read/
- write access; then the found file will be added to the
- sources.arc archive file; then the sources.arc file will be
- set to read only mode; and finally, the archive bit on the
- file found will be turned off.
-
- ======================================================================
-
- TECHNICAL REFERENCE
-
- ----------------------------------------------------------------------
- COMMAND: -a
-
- PURPOSE: To select files that have the ARCHIVE bit on
-
- EXAMPLE: whereis -a
-
- This would search the entire disk for all files that have
- the archive bit on.
-
-
- ----------------------------------------------------------------------
- COMMAND: -d
-
- PURPOSE: To select only directories
-
- EXAMPLE: whereis -d
-
- This would search the entire disk for sub-directories
-
-
- ----------------------------------------------------------------------
- COMMAND: -f filename
-
- PURPOSE: To include a filename that has whereis switches in it.
-
- EXAMPLE: whereis -f whereis.dat
-
- This would cause the whereis program to look in the file
- specified for switches as well as the command line.
-
- So, if the file WHEREIS.DAT included the following:
-
- -r
- -n *.TXT
- -n *.DOC
- -n *.me
-
- This would be the same as the command line version:
-
- whereis -r -n *.txt -n *.doc -n *.me
-
-
- ----------------------------------------------------------------------
- COMMAND: -h
-
- PURPOSE: This will cause WHEREIS to look for files that have the
- hidden file bit on.
-
- EXAMPLE: whereis -h
-
- This would cause whereis to search the entire disk for
- all files that are "hidden".
-
-
- ----------------------------------------------------------------------
- COMMAND: -n filename
-
- PURPOSE: This is to specify the filename or wildcard search to
- perform.
-
- EXAMPLE: whereis -n *.txt
-
- This would cause WHEREIS to search the entire disk for
- all files that have a ".txt" extension.
-
- Several "-n filename" may be use on the command line or
- included in the "switch file" (see the -f option above).
-
- If you wanted to find all files that have the ".obj",
- ".c" and the ".exe" extensions, you could tell whereis
- three times:
-
- whereis -n *.obj
- whereis -n *.c
- whereis -n *.exe
-
- or you could put all three name searches on the same
- line:
-
- whereis -n *.obj -n *.c -n *.exe
-
-
- ----------------------------------------------------------------------
- COMMAND: -o filename
-
- PURPOSE: This option redirects the files found from the stdout
- (terminal) to a filename specified.
-
- EXAMPLE: whereis -n *.arc -o output.tmp
-
- This would cause the output that would normally go to the
- screen; to go to the filename output.tmp
-
-
- ----------------------------------------------------------------------
- COMMAND: -r
-
- PURPOSE: This will cause whereis to include files that have the
- read only bit set.
-
- EXAMPLE: whereis -n *.txt -r
-
- This will find all files on the logged device that end in
- the extension ".txt" and that have their read-only bit
- set.
-
-
- ----------------------------------------------------------------------
- COMMAND: -s number
-
- PURPOSE: This will cause whereis to include files that have a size
- equal to or greater than the number given as a parameter.
-
- EXAMPLE: whereis -n *.arc -s 200000
-
- This will command whereis to find all ".arc" files that
- have a size of 200K bytes or more.
-
-
- ----------------------------------------------------------------------
- COMMAND: -t
-
- PURPOSE: This option will command whereis to provide some simple
- statistics on the search it just completed.
-
- EXAMPLE: whereis \etc -a -r -n *.arc -t
-
- WHEREIS SEARCH TOTALS
-
- Files on disk: 643
- Bytes in files: 11564176
- Hidden files: 0
- Archive files: 191
- Read only files: 3
-
- Files that matched search: 24
- Bytes in files that matched search: 1239835
-
-
- ----------------------------------------------------------------------
- COMMAND: -x "command string"
-
- OPTIONS: %f -- filename, ie, doofus.txt
- %p -- pathname, ie, C:\USR\TEST\DOOFUS.TXT
-
- PURPOSE: This option will cause whereis to eXecute the program or
- the dos function inside the command string.
-
- EXAMPLE: whereis -n *.txt -x "print %f"
-
- In this example, the command options instruct the whereis
- program to find all files on the logged disk device that
- ends in the ".txt" extension. When the file is found,
- the command "print filename" will be executed.
-
- Say, for example, that the whereis found the filename
- "foobar.txt". The command option, -x "print %f",
- instructs the whereis program to replace the %f with the
- filename that it found. So, the string "print %f" would
- be expanded to "print foobar.txt".
-
- Once the filename has been expanded, the execution
- string "print foobar.txt" would be instructed to be
- executed.
-
- There is no limit on what programs can be run or what
- they do. Although it is advised, that they do not
- remove directories; as this could disturb the normal
- operation of the whereis program.
-
- This option as well as the name (see -n above) option can
- be stacked. This means you can use more than one -x
- option on a command line (or in a -f file -- see above).
-
- Example:
-
- whereis -n *.txt -x "copy %f c:" -x "del %p"
-
- This command line above will search the entire logged
- device for all files that end with the extension
- ".ext". When the whereis programs finds a match it
- will perform each "-x" command in the order they
- appear on the command line (or in the whereis data file
- -- see the -f option above). So, in this example,
- after it has found a match it will cause the first
- "-x" command to be run; this will copy the matched file
- to the c: drive. Then it will delete the file using
- the full pathname found.
-
-
- ----------------------------------------------------------------------
- COMMAND: -D MMDDYY
-
- PURPOSE: This command option will cause whereis to search for
- files whose date is equal to or greater than the date
- given as the required parameter to this option.
-
- EXAMPLE: whereis -D 050188
-
- This example will cause whereis to search the entire disk
- for all files that have a date equal to or greater than
- May 1, 1988 (050188).
-
-
- ======================================================================
-
- You can use any or all of the command line options in a whereis
- search. Each option presented on the command line, or in a command
- file, or both; is evaluated if the previous command option was
- successful. All options must be true, if the search is successful.
-
- Example:
-
- whereis -a -r -n *.arc -x "arc -v %f"
-
- In the above example, if the file the whereis program is examining
- has the archive bit set, it will then examine the file to see if it
- has the read-only bit set. If it doesn't then the search proceeds to
- the next file.
-
- So, in the above example, if a file HAS the ARCHIVE bit SET, and it
- has its READ-ONLY bit SET, and the file ends in an ".arc" extension,
- the pathname will be printed to the standard output and the command
- in the "-x" string will be executed.
-
- ======================================================================
-
- LICENSE STATEMENT
- ------------------
-
- Handmade Software and Kenneth R. Waletzki are the sole owners of this
- software. This software is protected by both United States copyright
- law and international treaty provisions. Use of this software is
- allowed only if you have mailed a $20 payment to Handmade Software,
- 4141 Ball Road, #240, Cypress, California, 90630-3465. Only by
- paying the fee and registering your name with Handmade Software are
- you considered a legal user of this program.
-
- This software is just like a book, with the following single exception.
- Handmade Software authorizes you to make archival copies of the
- software for the sole purpose of backing-up our software and
- protecting your investment from loss.
-
- You may use this software on more than one computer, if you pay $20 for
- each instance of this software on each computer. For example, if
- your company has 10 computers and this program is on each one of them,
- you must register for 10 copies of this program ($200).
-
- Quantity Discount Schedule:
-
- Quantity Cost Each
- -------------------------
- 1 - 10 $20 each
- 11 - 50 $16 each
- 51 - 100 $13 each
- over 100 $11 each
-
- DISTRIBUTION
-
- Handmade Software will allow you to distribute this software to any
- individual or company, and we encourage you to do so. However,
- you cannot charge any monetary fee for doing so, unless you contact
- Handmade Software and we authorize you to do so in writing. If
- you distribute this program, you must also include this document in
- an unmodified and original format.
-
-
- WARRANTY
-
- No warranty at all is implied. Use of this software is "as-is".
- This warranty shall not encompass any damages, including but not
- limited to loss of profit, and special, incidental, consequential or
- similar claims.
-
- Handmade Software specifically disclaims all other warranties,
- expressed or implied, including but not limited to implied warranties
- of merchantability and fitness for a particular purpose with respect
- to defects in the diskette and documentation, and the program license
- granted herein in particular, and without limiting operation of the
- program license with respect to any particular application, use, or
- purpose. In no event shall Handmade Software be liable for any loss
- of profit or any other commercial damage, including but not limited
- to special, incidental, consequential or other damages.
-
- GOVERNING LAW
-
- This statement shall be construed, interpreted, and governed by the
- laws of the State of California.
-
- ----------------------------------------------------------------------
-
-
-
- Become one of the many supporters of shareware software. If you like
- this program, use it, give it to your friends (please include this
- document when you distribute it), and send your $20 to become a
- registered user!
-
- Encourage the shareware process! Register today!
-
- Sincerely,
-
- Kenneth R. Waletzki
- Handmade Software
- 4141 Ball Road, #240
- Cypress, CA 90630-3465
-