[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: format grep ouput



BartlebyScrivener wrote:
On Jul 15, 2:30 pm, Ron Johnson <ron.l.john...@cox.net> wrote:

Try this.  It's untested but should nudge you in the right direction.

Almost, it prints each word on a separate line, but I'll pursue the
idea.

Thank you,

rd
grep -R 'the' * | (of=""; while read f l ; do if [ "$f" != "$of" ] ; then echo ; fi; echo $f $l ; of=$f; done)

will put a linebreak after every new filename, as long the none of the filenames have spaces in.



Reply to: