3 ms·
There are problems with the manipulation of binary data in bash, as discussed here: https://unix.stackexchange.com/questions/278639/how-can-i-work-with-binary-i
by theoh 8y ago
There are problems with the manipulation of binary data in bash, as discussed here: https://unix.stackexchange.com/questions/278639/how-can-i-work-with-binary-in-bash-to-copy-bytes-verbatim-without-any-conversio https://unix.stackexchange.com/questions/278639/how-can-i-wo...
In particular, the value 0 can't be stored in a bash variable, which almost completely rules out the possibility of byte-by-byte processing of general binary data. It's probably possible with absurd hacks.
Quite apart from that, error handling in bash is an awkward chore which few scripts get right. It's a very unappealing language for writing anything more than a five-line script. https://www.davidpashley.com/articles/writing-robust-shell-scripts/ https://www.davidpashley.com/articles/writing-robust-shell-s...
- floatingatoll 8y agoIf you read a byte without EOF and have a variable length of 0 afterwards, you read a NUL.