Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the ack CPAN distribution.

Maintainer(s)' notes

ack's issues are tracked at https://github.com/petdance/ack2

Report information
The Basics
Id: 20690
Status: rejected
Priority: 0/
Queue: ack

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.24
Fixed in: (no value)



Subject: More filetypes to ignore
Your script reminds me of a shell script of mine which does a subset of ack: a recursive grep, but with more filetypes to ignore. It would be nice to ignore every kind of binary file, but this is not so easy: you have to look into a file to decide whether it's binary. Also, a binary/invalid character in one encoding may be a valid character in another encoding. Here's the script: find . -type f -a ! \( \ -regex ".*/blib/.*" \ -o -regex ".*/CVS/.*" \ -o -regex ".*/RCS/.*" \ -o -regex '.*,v$' \ -o -regex ".*/.svn/.*" \ -o -regex ".*/\\.svn/.*" \ -o -regex ".*\\.[oa]" \ -o -regex ".*~" \ -o -regex ".*/#[^#]*#" \ -o -regex ".*\\.gz" \ -o -regex ".*\\.bz2" \ -o -regex ".*\\.bak" \ -o -regex ".*\\.tgz" \ -o -regex ".*\\.tbz" \ -o -regex ".*\\.gif" \ -o -regex ".*\\.jpe?g" \ -o -regex ".*\\.png" \ -o -regex ".*\\.elc" \ -o -name ".#*" \ -o -name "Makefile.old" \ \) -print0 | xargs -0 grep "$@" Explanation: .*,v$ ignores RCS files which are created outside of an RCS directory. .*/#[^#]*#" ignores emacs autosave files. .*~ ignores emacs backup files. .*\\.elc are compiled emacs lisp files. Regards, Slaven
I don't want to go down this road, because if it's an unrecognized filetype, ack will ignore it anyway.
Thanks.