Date: Wed, 25 Sep 2024 20:03:56 +0200 From: tlaro...@kergis.com Message-ID: <zvrqjag2qzt-6...@kergis.com>
| But a nul byte given as an escaped sequence does not generate an error | and is discarded (present implementation OK, since choice up to the | implementation) conforming to (issue 8, taken from 2.2.4 | Dollar-Single-Quotes, and applying consistency): $'' has nothing to do with it, that is describing chars that will become part of the script, not input to a utility, the relevant text is in read ... If the -d delim option is not specified, or if it is specified and delim is not the null string, the standard input shall contain zero or more bytes (which need not form valid characters) and shall not contain any null bytes. When we have invalid input we can treat it as an error, or we can do something different. Currently we just ignore them. They can't be included. But if (from your earlier message) stopping at \0 isn't going to help, then there's no point changing things. I had assumed that the files being checked were generally either #!/whatever files, or binaries. If there are javascipt, html, and all kinds of other stuff included, then the \0 check might indeed be not all that useful - but as I said, that wasn't intended as an alternative to -n, just as something that could reasonably be done which would allow "read var < file" to work better than it does now, without needing to be modified. kre