Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Nov 2019 15:24:26 +1100
From:      MJ <mafsys1234@gmail.com>
To:        thor <thor@irk.ru>, freebsd-questions@freebsd.org
Subject:   Re: grep for ascii nul
Message-ID:  <8af5cac6-827e-9420-fe14-204bd4490976@gmail.com>
In-Reply-To: <2c08387c-425b-060d-4f9b-3443a3f6a18f@irk.ru>
References:  <20191101024817.GA60134@admin.sibptus.ru> <2c08387c-425b-060d-4f9b-3443a3f6a18f@irk.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

On 1/11/2019 2:07 pm, thor wrote:
> There is NO such thing as filenames containing 0x00 inside the filename. UNIX filenames are strings in C meaning and may contain any 8-bit values except "/" which delimits the subdirectory names and 0x00 which marks the end of filename string.
>
> At least it was so when I first met Unix, and I hope Bill Gates never influenced Unix since this time.


Nope you're right, no \0 allowed in filenames. None, nada, zilch.



> On 11/01/19 10:48, Victor Sudakov wrote:
>> Dear Colleagues,
>>
>> 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.
>>
>> NB I don't need to delete the nul character with sed or tr, just need to
>> find files containing it.
>>
Victor,

If you do find a file with it in, I suggest you bottle it and place it alongside your unicorn.

MarkJ





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8af5cac6-827e-9420-fe14-204bd4490976>