Ack doesn't do recursive grep

ack (the grep tool written in Perl) does not find the file that grep -r finds, and I cannot find the parameters I need to make it work. The following shows that ack did not find the target line, which is located in a regular file in a subdirectory. It is in the Bash shell (Ubuntu 11.04):

 100 $ grep -r imbue * hel/find: the fact that some shells including Bash imbue braces ## Note: grep find it as shown in the above. 101 $ ./ack-standalone imbue ## Note: ack didn't find it as shown in the above. 102 $ ./ack-standalone --version ack 1.96 Running under Perl 5.10.1 at /usr/bin/perl Copyright 2005-2011 Andy Lester. This program is free software. You may modify or distribute it under the terms of the Artistic License v2.0. ## This is the testing folder structure: 103 $ tree . ack-standalone hel |- dot |- find |- grep |- jobs perlman perlre perlrequick perlrun perlvar xargs 1 directory, 11 files 

Version 2 of ack, from installing the apt-get package, got the same results. In the standalone version (version 1) shown above. ack -f shows nothing, and I tried the -r and * options, all with the same results.

On another Ubuntu 10.04 machine, it works like a charm.

+4
source share
1 answer

It works for me if I choose to work in all files regardless of its type using the -a switch (my version is the same as yours):

 ack -a imbue * 
+8
source

Source: https://habr.com/ru/post/1403922/


All Articles