bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "printf -v foo bar" sets $? to 1


From: Lawrence Velázquez
Subject: Re: "printf -v foo bar" sets $? to 1
Date: Sat, 14 Aug 2021 20:21:18 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-554-g53a5f93b7d-fm-20210809.002-g53a5f93b

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 <chet.ramey@case.edu>
>         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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]