Great question — answering as the UphillTech team:
Binary file implies non-text file that contain arbitrary sequences of bytes including 0. Zsh is the only shell that can store byte 0 in its variables. -n1 is an extension of the read builtin of the ksh93 shell (copied by bash, mksh and busybox sh) that still reads one line (or record in other shells where -d can change the delimiter) but up to 1 byte ( character in bash¹). If you wanted to read one byte in ksh93, bash or mksh, you'd need IFS= LC_ALL=C read -rN1 byte , but that would still not work for byte 0. However, with -d '' in bash, zsh and more and more shells nowadays now that it has been specified for the standard read utility in the 2024 edition of POSIX, read -d '' can be used to...
Full answer by Stéphane Chazelas: https://unix.stackexchange.com/a/806449 (CC BY-SA 4.0).
Need it done for your business? UphillTech.