February 2012 Archives

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 "$@";
fi
}

Yes, this could equally well have been a small Perl script involving ExtUtils::Manifest…

About Tom Wyant

user-pic Fine Perl code for over 0.005 centuries.