FINDSRC(1L)

NAME
findsrc - walk directories, trying to find source files

SYNOPSIS
    findsrc [ -dy_or_n ] [ -h# ] [ -l ] [ -m ] [ -npattern ] [ -Npattern ] [ -oname ] [ -r ] [ -s ] [ -v ] [ -x ] [ -ypattern ] [ -Ypattern ] [ file... ]

DESCRIPTION
Findsrc recursively examines all directories and files specified on the command line, and determines, based on the file name, whether the file contains source code or not. All directories are listed first, followed by all regular files, with one item per line.

Findsrc has a built-in table of shell wildcard patterns that it uses to determine whether or not a file is source or not. To add to the table, use the ``-y'' or ``-n'' options. Both options take a shell pattern; the ``-y'' indicates that the pattern is to be included, and the ``-n'' indicates that files matching the pattern are to be excluded. For the patterns, an asterisk means any zero or more characters, and square brackets match any characters in the brackets. For example, ``-yconfig.*'' will add the configuration files distributed with the shar package, while ``-nPart0[0-9]'' will exclude shar kits. To just see the pattern table, use the ``-x'' option. The order in the table is important, so patterns added on the command line will be inserted at the start of the table. Note that patterns are added in the order in which they appear in the command line, so to exclude all but one log file, use this order ``-n\*.log -ypatch.log.''

The ``-y'' or ``-n'' options only look at the last component of the filename. To compare the full pathname of the file against the pattern, use the uppercase version of the letter. For example, ``-N*/junk/*'' will skip all files in any directory named ``junk.''

Note that since the patterns used contain shell wildcard characters, they will have to be quoted to prevent the shell from trying to do the expansion.

If it is unable to make a decision, it invokes the file(1) command, and prompts the user for a decision. In reply to the prompt, type the letter ``y'' or ``n'' (either case); a simple return is taken to mean ``yes.'' If the reply starts with an exclamation point, the rest of the line is passed off to a sub-shell and the question is repeated. The ``-d'' option may be used with an argument of ``y'' or ``n'' to by-pass the interaction, and provide a default answer.

The ``-o'' option may be used to specify an output filename. This is designed to prevent confusion if a command like the following is executed:
    findsrc . * >LIST

As a convenience to maniscan(1L) and makekit(1L), findsrc can put some leading blank lines at the top of its output. These are normally skipped by maniscan and turned into manifest headers by makekit. The ``-h'' option may be used to indicate the number of header lines to generate. The ``-m'' option is the same as giving the options ``-oMANIFEST -h2.''

By default, findsrc ignores RCS and SCCS files and directories; using either the ``-r'' or ``-s'' option causes both to be included.

Findsrc normally lists only the names of those files that have been selected. If the ``-l'' option is used, rejected files are logged to the output preceeded by the word ``REJECTED.''

If no files are specified on the command line, the program operates as a filter, reading a list of files and directories from the standard input, one per line.

The ``-v'' option prints out the current version and exits.

SEE ALSO
makekit(1L).