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

Rich Salz rsalz at bbn.com
Sun Jun 25 01:38:27 AEST 1989


>    fgrep BLAH *.[ch] | cgname /tmp/123 
>    vi `cat /tmp/123`

At the expense of running the command twice, this can be done with
the standard tools:
	fgrep BLAH *.[ch]
	vi `fgrep -l BLAH *.[ch]`
Usually most folks will just skip the first invocation.

I use the following CSH aliases often:
	alias S 'set x = ( \!* )'
	alias F 'fgrep -l \!$ $x'
	alias V 'vi +/\!$ `fgrep -l \!$ $x`'

For example:
	prompt% cd ~/typedef
	prompt% S *.[cylh]
	prompt% V TypeDefinition
-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.



More information about the Alt.sources mailing list