while grep is written in C, zgrep is written in posix sh, and the bug was from using sed to escape arguments, and sed being a line-oriented utility that is non-ideal for operating on newline-containing strings (i.e. linux filenames).
while grep is written in C, zgrep is written in posix sh, and the bug was from using sed to escape arguments, and sed being a line-oriented utility that is non-ideal for operating on newline-containing strings (i.e. linux filenames).
It's like all sh
Learning git itself is non-intuitive, but the gpg utilities take the learning curve to a whole other level. If you want to make simple use of the gpg utilities, you should plan on setting aside a few full days to learn how they work. Or just use pass, which additionally leverages git for password history.
fopen() takes a null-terminated filename, so if there is a null byte in the middle it would just truncate the filename.
That said, pretty much every filesystem's on-disk format has an explicit length field for file names. So in theory, there's nothing stopping them from supporting completely binary filenames - it's the kernel's VFS layer that treats NUL and / as special.
Sample usage to escape var called v v="$(printf '%q' "$v")"
I used it myself when I wrote a script that generates a self executing bash script to restore mtimes for directories[2]
[1]: https://www.gnu.org/software/bash/manual/bash.html#ANSI_002d...