grep for ascii nul
feenberg at nber.org
Fri Nov 1 13:17:04 UTC 2019
On Fri, 1 Nov 2019, Kurt Hackenberg wrote:
> On 2019-10-31 22:48, Victor Sudakov wrote:
>> How can I print the names of files containing ascii nul (\x0)? The
>> FreeBSD "grep -l" does not seem to be able to do it.
> Yeah, no. Probably grep takes that NUL as the end of the C string that is
> that command-line argument.
> You could use the attached program, which I wrote some time ago for this
I don't think the FreeBSD (or any Unix-like system) will create a file
name with an embedded null byte. If you tried, the name would end at the
null byte anyway. Perhaps the original poster has some corruption in his
filesystem that manifests itself in a way that suggests a null byte? Or
the file name could be in an archive of some sort? More information is
required if help is to be given.
The rule that a filename can not contain a null byte is more like the law
of gravity than a standard that a programmer might casually ignore.
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions