Path: utzoo!attcan!uunet!husc6!bbn!bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: alt.sources Subject: Re: cgname - collect file names from {e,f,}grep output Message-ID: <1843@papaya.bbn.com> Date: 24 Jun 89 15:38:27 GMT References: <130@tridom.uucp> Organization: BBN Systems and Technologies Corporation Lines: 21 > 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@uunet.uu.net. Use a domain-based address or give alternate paths, or you may lose out.