Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ack is not doing a recursive grep

Tags:

grep

ack

ack (the grep tool written in Perl) does not find a file that grep -r finds, and I cannot find the right options to get it to work. The following shows ack did not find the target string, which is in a regular file in a sub-directory. It's on 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 apt-get package installation, got same results. In the stand-alone version (version 1) shown above. ack -f shows nothing, and I tried the -r and * options, all with the same results.

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

like image 747
Andrew_1510 Avatar asked Feb 22 '23 00:02

Andrew_1510


1 Answers

It works for me if I select to operate in all files regardless of its type, using -a switch (my version is same that yours):

ack -a imbue *
like image 89
Birei Avatar answered Feb 27 '23 09:02

Birei