|
|
|
|
|
by petdance
4419 days ago
|
|
> after all project/bin/foo (executable) might be a python or perl or whatever script -- not just a binary file. That's one of the big features of ack that the find/grep combo can't replicate is checking the shebang of the file to detect type. In ack's case, Perl and shell programs are detected both by extension: --type-add=perl:ext:pl,pm,pod,t,psgi
--type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
And by checking the shebang: --type-add=perl:firstlinematch:/^#!.*\bperl/
--type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
Run `ack --dump` to see a list of all the definitions. |
|