Re: read -d no longer accepts NUL as line delimiter from tty

Chet Ramey <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 2/5/26 6:15 AM, Martin D Kealey wrote:
> When I go
> 
>      read -d '' VAR
> 
> it doesn't accept the line of input when I type the NUL byte (variously ^@,
> ^`, or ctrl-space depending on the keyboard).
> 
> It turns out that's because  _POSIX_VDISABLE is '\0' on my system; I
> suspect that's typical, though I have seen systems where it's '\xff'.

Thanks for the report. It's 255 on macOS, and presumably most BSD-based
systems, and Solaris, at least. Looks like Linux uses 0.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCaYS+vwUDAAAAAAAKCRC7WGnwZOp0q/a1
AJ9Hh8GsGIWS14dhvR5WKBgPtwYTnACfSPVGFqp5PYdOf4Eb3l6d6HvG66U=
=VI3c
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.