From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fee84,46b2b8d209363a80 X-Google-Attributes: gidfee84,public From: ed wolfe Subject: Re: find, grep, basename usage? Date: 1999/01/08 Message-ID: <369638DA.41C6@umich.edu>#1/1 X-Deja-AN: 430237599 Content-Transfer-Encoding: 8bit References: <36953626.41C6@umich.edu> <3695B257.EEEFC387@datenrevision.de> Content-Type: text/plain; charset=iso-8859-1 X-Trace: news.itd.umich.edu 915814686 141.214.99.156 (Fri, 08 Jan 1999 11:58:06 EDT) Organization: Univ of Michigan MIME-Version: 1.0 NNTP-Posting-Date: Fri, 08 Jan 1999 11:58:06 EDT Newsgroups: comp.unix.osf.osf1 thanks! another respondent suggested using xargs, which is what I was trying to recall: find . -name Makefile -exec grep -w RoiUi.o {} \; | xargs -n1 basename Rolf Hauck wrote: > > 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 ... ... > > --------------------------------------------------------------- > > Name: vcard.vcf > Part 1.2 Type: text/x-vcard > Encoding: 7bit > Description: Visitenkarte f�r Rolf Hauck