man grep me diz:
--binary-files=TYPEIf the first few bytes of a file indicate that the file contains binary data, assume that the file is of type
TYPE. By default, TYPE isbinary, and grep normally outputs either a one-line message saying that a binary file matches, or no message if there is no match. If TYPE iswithout-match, grep assumes that a >binary file does not match; this is equivalent to the-Ioption. If TYPE istext, grep processes a binary file as if it were text; this is equivalent to the-aoption. Warning:grep --binary-files=textmight output binary garbage, which can have nasty side effects if the output is a terminal and if the terminal driver interprets some of it as commands.
, então parece que -I pode funcionar para você? (Lembre-se, é totalmente possível que grep seja confundido por qualquer caractere não-ASCII no início do arquivo.)
Ah, e eu acho que você realmente não precisa do primeiro gawk , find … -exec deve trabalhar com isso, possivelmente com a opção -0 para finalizar os nomes dos arquivos encontrados com um byte nulo.