what about (ksh example): for file in $(find . -name '*.mak') do if grep -q YourFilename $file then basename $file fi done HTH Rolf ed wolfe schrieb: > > I'm trying to come up with a command that will search every *.mak file > in a directory heirarchy for a specific filename, and report just the > base filename (i.e., only what appears after the last / ), but can't > quite get what I need. Part of the trouble seems to be that basename > won't take multiple filenames from a pipe. I'm pretty sure I've seen > something like this somewhere, but have no idea where. > > any suggestions appreciated ... ...