15 Oct
2016
15 Oct
'16
6 p.m.
On 15 Oct 2016, at 6:52 pm +1000, Allan McRae wrote: > On 15/10/16 12:27, Ivy Foster wrote: > > On 14 Oct 2016, at 10:07 pm -0400, Andrew Gregory wrote: > >> On 10/14/16 at 08:21pm, ivy.foster@gmail.com wrote: > >>> From: Ivy Foster <ivy.foster@gmail.com> > > > + mapfile -t refs < <(find "$pkgdir" -type f -exec grep -n "${!var}" {} +) > > > >> For packages with just a single file this won't print the name of the > >> matching file. GNU grep has -H for this, but it's not POSIX. What > >> about including /dev/null as an argument to grep so that it always has > >> more than one file? > > > > Ah, you're quite right. I'll fiddle with that and resubmit tomorrow, then. > > > > Why no use -l? > > -l, --files-with-matches print only names of FILEs containing matches I can do that instead, if you prefer. Personally, I wanted to use -n rather than -l, because it matches the format of compiler warnings (for ease of opening directly to the right line in your editor). Using -l would have the benefit of being less verbose, I suppose. Ivy