cgname - collect file names from {e,f,}grep output

Jeff Beadles jeff at quark.WV.TEK.COM
Sun Jun 25 10:20:41 AEST 1989


In article <130 at tridom.uucp> wht at tridom.uucp (Warren Tucker) writes:
|This quickie collects the filenames produced by grep output
|while passing the output oin to stdout.  I wrote it to help
|me build a list of filenames to edit containing a certain string:
|
|usage: {e,f,}grep <pattern> <flist> | cgname <cfile> [| ...]\n");
|collects list of files reported by grep into <cfile>\n");
|cgname reads grep output, passing it on to cgname's stdout\n");
|and produces a sorted list of filenames into <cfile>\n");
|
|i.e.:
|
|    fgrep BLAH *.[ch] | cgname /tmp/123 
|    vi `cat /tmp/123`
|
|{awk,sed,perl}-fanatic flames > /dev/null

Well, with a line like above...  I'm a 'cut' fan.  Try this:  It's a LOT
easier to maintain and manage.  (Smaller on disk too :-)

fgrep BLAH *.[ch] | cut -d: -f1 | sort | uniq > /tmp/123 ; vi /tmp/123

This is not a flame.	This is not a flame.	This is not a flame.
This is not a flame.	This is not a flame.	This is not a flame.

	-Jeff
--
Jeff Beadles		Utek Sustaining Engineering, Tektronix Inc.
jeff at quark.WV.TEK.COM	(or) uunet!tektronix.tek.com!quark.wv!jeff



More information about the Alt.sources mailing list