From: ed wolfe <ewolfe@umich.edu>
Subject: Re: find, grep, basename usage?
Date: 1999/01/08 [thread overview]
Message-ID: <369638DA.41C6@umich.edu> (raw)
In-Reply-To: 3695B257.EEEFC387@datenrevision.de
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
prev parent reply other threads:[~1999-01-08 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-07 5:00 find, grep, basename usage? ed wolfe
1999-01-08 5:00 ` Rolf Hauck
1999-01-08 5:00 ` ed wolfe [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox