.TH srcpath "" "" Command
.PC "Find source files"
\fBsrcpath [\-aw] [\-p \fIpath\^\fB] \fIfilename pattern\fB ...\fR
.PP
.HS
.SH Options:
.IC \fB\-a\fR
Disable shadowing:
print all instances of file it finds along \fBSRCPATH\fR, not just first
.IC "\fB\-p\fI path\fR"
Use \fIpath\fR instead of \fBSRCPATH\fR
.IC \fB\-w\fR
Print warning when you lack permission to read file or directory
.HE
The command
.B srcpath
expands the environmental variable
.BR SRCPATH ,
applies it to each argument, and prints the full path of each unique result.
.PP
An argument can either be a file name or a pattern.
For example, the command
.DM
	srcpath "*.[ch]"
.DE
.PP
finds all
.B .c
and
.B .h
files on
.BR SRCPATH .
By default.
.B srcpath
keeps only the first file that it finds with a given name.
.B srcpath
automatically appends `.' to the beginning of
.B SRCPATH
so files in the current directory have precedence.
.PP
.B srcpath
recognizes the following command-line options:
.RS
.IP "\fB\-p \fIpath\fR" 0.3i
.br
Use
.I path
as its path instead of
.BR SRCPATH .
For example,
.ID
	srcpath -p ".:/usr/src/cmd" "*.c"
.IE
tells
.B srcpath
to search `.' and
.B /usr/src/cmd
instead of 
.BR SRCPATH .
Note that with this option,
.B srcpath
does not automatically place `.' at the beginning of the list.
.IP \fB\-a\fR
Disable shadowing.
Normally, if
.B srcpath
finds a file is found in more than one directory on the path,
it prints only the first.
The \fB\-a\fR option forces
.B srcpath
to print all instances of the file name.
.IP \fB\-w\fR
By default,
.B srcpath
silently bypasses directories and matching files for which
it has no read permission.
The \fB\-w\fR option causes it to print a warning message when this happens.
.RE
.SH "See Also"
.Xr "commands," commands
.Xr "find," find
.Xr "make," make
.Xr "PATH" path
