On Sat, Aug 14, 2021, at 7:56 PM, Keith Thompson wrote:
> Bash Version: 5.1
> Patch Level: 4
> Release Status: maint
>
> Description:
> The builtin "printf" command with the "-v" option works
> correctly, but it reports failure by setting $? to 1.
>
> The problem was introduced by this commit; I've confirmed
> that it doesn't occur with its immediate predecessor.
>
> commit a30f513fc4cd507e74de6f0d0006b289a017a0d0
> Author: Chet Ramey <[email protected]>
> Date: 2021-05-13 14:49:18 -0400
>
> more changes to handle @ and * as associative array keys
>
>
> Repeat-By:
> if printf -v foo bar ; then echo OK ; else echo FAILED ; fi
Have you tried a newer build?
% bash --version | head -n 1
GNU bash, version 5.1.8(1)-release (x86_64-apple-darwin18.7.0)
% bash -c 'printf -v foo bar; echo $?'
0
--
vq