From: Rolf Hauck <Rolf.Hauck@datenrevision.de>
To: ed wolfe <ewolfe@umich.edu>
Subject: Re: find, grep, basename usage?
Date: 1999/01/08 [thread overview]
Message-ID: <3695B257.EEEFC387@datenrevision.de> (raw)
In-Reply-To: 36953626.41C6@umich.edu
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
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 ... ...
[-- Attachment #2: Visitenkarte f�r Rolf Hauck --]
[-- Type: text/x-vcard, Size: 240 bytes --]
begin: vcard
fn: Rolf Hauck
n: ;Rolf Hauck
org: datenrevision GmbH
email;internet: Rolf.Hauck@datenrevision.de
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
next 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 [this message]
1999-01-08 5:00 ` ed wolfe
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