2 ms·
I have a shell function that generates shell functions that do find | xargs ... patterns. Thus I have 'fsg' == find source grep -- that is, find with -name arg
by cryptonector 9y ago
I have a shell function that generates shell functions that do find | xargs ... patterns. Thus I have 'fsg' == find source grep -- that is, find with -name arguments matching source | xargs grep ..., and fseg (find source egrep) and fmg (find make stuff grep). These functions take all non-option looking arguments and use them as directory arguments for find, then all remaining arguments are passed to grep, so I get to write:
$ fsg foo bar -w foo
which translates into something like:
find foo bar \( -name '*.[chylm]' -o -name ... \) -print0 | xargs -0 grep "$@"
Still, cscope is fantastic, and the first tool I reach for.