3 ms·
I found out about ack awhile back -- it's like grep on steroids.
by endlessvoid94 16y ago
I found out about ack awhile back -- it's like grep on steroids.
- spudlyo 16y agoI'm a big fan of ack, I love the --output feature, which is super handy. Unfortunately it is hardly ever installed when I need it. It's considerably slower than the highly tuned GNU regex code, which only really matters when you're grepping through a ton of material.
- gnosis 16y agoCould you give an example of something useful one could do with ack's --output feature? The manual's a little light on the details. All it says is: --output=expr Output the evaluation of expr for each line What expression are they talking about? A regular expression? If so, how is that different from a normal grep?
- neild 16y agoA Perl expression. You could use this for sed-like activities: # Print included files. ack --output '$1' '#include <(.*)>' You could presumably do much trickier things as well, since the --output argument can contain any Perl expression.
- betterthangrep 16y agoThat's a great example. I just replaced it as the example in the Top 10 List on the front of betterthangrep.com. Thanks.
- deleted 16y ago[deleted]
- slowpoison 16y agoOn Ubuntu, the package name is ack-grep. So use: sudo -i aptitude install ack-grep Don't go for ack, which is some Kanji character converter.