From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] grep -lr ignoring subdirs that start with dot (.)?
Date: Thu, 23 Apr 2015 15:45:32 +0100 [thread overview]
Message-ID: <20150423154532.3c1ad6a9@digimed.co.uk> (raw)
In-Reply-To: <5538D866.80309@libertytrek.org>
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
On Thu, 23 Apr 2015 07:32:54 -0400, Tanstaafl wrote:
> What I'd like is the output you get with
>
> 'grep -ir "searchstring" .'
>
> which includes the line of text from each matching file that contains
> the searchstring, like this:
>
> > ./user/Maildir/cur/1429731479.M511050P25876.hostname,S=3097,W=3185:2,S:Name
> > asked me to approve Test PO 12036 this afternoon so she could
> > see ./user/Maildir/cur/1429731479.M511050P25876.hostname,S=3097,W=3185:2,S:it
> > in the system. In looking at Test PO 12033 & 12034 they show
> > signed ./user/Maildir/cur/1429731479.M511050P25876.hostname,S=3097,W=3185:2,S:by
> > me however I did not approve these test PO's only test PO 12036 -
> > how ./user/Maildir/cur/1429731479.M511050P25876.hostname,S=3097,W=3185:2,S:
> > Name asked me to approve Test PO 12036 this afternoon so she could
>
> but...
>
> What I'd like is for each output line showing the file-hit to be
> prefaced with at least the date/time of the file (permissions/owner etc
> would be ok too, but I at least need the date/time), like you get when
> doing an ls -al...
Something like this?
for i in $(grep -lr searchstring .);do
ls -l $i
grep -H searchstring $i
done
I'm sure you could format it better using the options from ls.
--
Neil Bothwick
I am McCoy of Bo...Damnit! I'm a doctor, not a collective!
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-04-23 14:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 20:57 [gentoo-user] grep -lr ignoring subdirs that start with dot (.)? Tanstaafl
2015-04-17 21:47 ` Todd Goodman
2015-04-17 22:02 ` covici
2015-04-17 21:59 ` Neil Bothwick
2015-04-23 11:32 ` Tanstaafl
2015-04-23 14:45 ` Neil Bothwick [this message]
2015-04-19 11:12 ` Andreas K. Huettel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150423154532.3c1ad6a9@digimed.co.uk \
--to=neil@digimed.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox