Hey, I am on a HP-UX server here. When recursively grepping a directory tree, I have problems when the tree also contains binary files: grep treats them as text files and displays very long lines containing a lot of non-printable characters. This not only makes the output hard to scan, but also often makes my terminal unusable (and writes funny strings to its title).
GNU-grep has an option
--binary-file= which would help (and it does not print the matching line anyway for binary files), but I do not have GNU-tools availabe.
Is there a way to simulate the behavior of GNU-grep or to ignore files that look like they are binary?
Btw. if there is an easy way to do this in perl, that would be fine, too.