On Wed, 23 Feb 2005, David J. Weller-Fahy wrote:
> You know, it's things like that started my habit of perusing the man
> page before composing a command. I found myself struggling over getting
> a command to do just what I wanted in a way I thought I remembered, and
> then found out there was a new option... ;]
>
> Anyway, while dinking around I found a regex to leave only the filename,
> so here's the complete command:
>
> find Maildir/ -type f -exec grep -iH ledoux {} \; | \
> sed 's/^\([^,]*,[^:]*\):.*$/\1/'
Uh, guys, what's wrong with simply using:
find MailDir/ -type f -exec grep -li ledoux \{\} \;
It lists just the filename, and nothing more. Now, given the example above
(if you *really* want to do a -iH) I would not use sed, but cut:
find MailDir/ -type f -exec grep -Hi ledoux \{\} \; | cut -d: -f1
--Arthur Corliss
Bolverk's Lair -- http://arthur.corlissfamily.org/
Digital Mages -- http://www.digitalmages.com/
"Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Feb 23 08:43:52 2005
This archive was generated by hypermail 2.1.8 : Wed Feb 23 2005 - 08:43:52 AKST