> Le 28 juil. 2025 à 20:27, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> a écrit : > > On Mon, Jul 28, 2025 at 8:15 PM Ben Knoble <ben.knoble@xxxxxxxxx> wrote: >>>> Le 27 juil. 2025 à 18:02, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> a écrit : >>> Simpler: >>> printf "$expected_value\0" >expected && >> >> (Below as well): the shell linter I use does prefer to see >> >> printf %s\\0 "$var" >> >> to avoid issues with the variable containing format specifiers. > > That's a very good point about using "%s"; I should have suggested > that myself. Thanks for the correction. > >> (Backslash has to be quoted in double-quotes, too, I think? So I left out the quotes here.) > > No, backslash does not need to be escaped in double-quotes. The > literal form `printf "%s\0"` is common enough in Git test scripts, so, > for consistency, that should be the form we recommend in reviews, not > the form lacking quotes, I'd think. Right; on second thought, shell quotes (mostly) don’t nest like that. Thanks for the catch.