[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFE: "-mtype" + -menc
From: |
Assaf Gordon |
Subject: |
Re: RFE: "-mtype" + -menc |
Date: |
Fri, 19 Apr 2019 20:11:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
Hello,
On 2019-04-16 8:13 p.m., L A Walsh wrote:
[...]
Very often I want to search for something but only in my shell or perl
scripts and likely within the past 'X' months, stringing everything
together in a pipeline is certainly possible but awkward when
what I really want to do is search for a string or function name in
all shell scripts:
There are existing tools that do so very well, for example 'ack'
(https://beyondgrep.com/):
ack --shell --perl 'foo|bar'
To limit searches by file attributes, combine with find/xargs:
find -type f -mtime -60 -print0 \
| xargs -0 ack --shell --perl 'foo|bar'
Or, if you wanted to list files based file-type (which
can be later combined with 'xargs -0'):
ack --shell --perl -f --print0
-assaf