From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,46b2b8d209363a80 X-Google-Attributes: gidfee84,public From: Rolf Hauck Subject: Re: find, grep, basename usage? Date: 1999/01/08 Message-ID: <3695B257.EEEFC387@datenrevision.de>#1/1 X-Deja-AN: 430106771 Cache-Post-Path: ns.work.de!news@internetserver.datenrevision.de References: <36953626.41C6@umich.edu> To: ed wolfe Content-Type: multipart/mixed; boundary="------------62FC2A5118E5C12EF7D6C19F" Organization: datenrevision GmbH X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Dies ist eine mehrteilige Nachricht im MIME-Format. --------------62FC2A5118E5C12EF7D6C19F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 ... ... --------------62FC2A5118E5C12EF7D6C19F Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Visitenkarte f�r Rolf Hauck Content-Disposition: attachment; filename="vcard.vcf" 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 --------------62FC2A5118E5C12EF7D6C19F--