Stupid ack trick

My source directories tend to collect cruft, and it can be a pain to separate the real ack hits from the crufty ones. I am ashamed to say how long it took me to think of the following:

function ackx {
if [ -f MANIFEST ];
then ack "$@" `sed 's/[[:space:]].*//' MANIFEST`;
else ack "$@";

Yes, this could equally well have been a small Perl script involving ExtUtils::Manifest, as a more portable implementation, and a cleaner way to get rid of any comments.

Leave a comment

About Tom Wyant

user-pic Fine Perl code for over 0.005 centuries.