[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid grep




On Mon, May 15, 2000 at 07:54:58PM -0500, Cloudmaster wrote:
> 
> So, does anyone know why this is:
> 
> sauer@pyro:~ > grep mirrorstuff.sh /var/log/messages
> Binary file /var/log/messages matches
> sauer@pyro:~ > file /var/log/messages
> /var/log/messages: ASCII text

This isn't terribly surprising.  The "file" command has to rely on
magic numbers and other probabilistic ways of determining the type,
while "grep" actually iterates over the whole file.  If a mostly text
file (like a log file) contains a character or two outside the normal
text range, grep will see it and flag the file as binary, while file
might miss it.

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.