[Bash-completion-devel] [bash-completion-Bugs][312183] printf -v not available in bash 3.0

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Thu Dec 24 17:58:37 UTC 2009


Bugs item #312183, was changed at 2009-12-24 15:59 by Freddy Vulto
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312183&group_id=100114

Status: Open
Priority: 3
Submitted By: Ville Skyttä  (scop-guest)
Assigned to: Freddy Vulto (fvu-guest)
Summary: printf -v not available in bash 3.0 
Distribution: None
Originally reported in: None
Milestone: 2.0
Status: None
Original bug number: 


Initial Comment:
The -v argument to printf was added in bash 3.1-alpha1, it is not available in bash 3.0.

Freddy, you have worked on the areas where printf -v is currently used, could you take a look?

FWIW, I'm not opposed to bumping the minimum required version to 3.1 if this is not sanely fixable otherwise.  (Or if it is fixable and you still have the testsuite running in cron, it'd be nice if it could be run with bash 3.0 as well...)

----------------------------------------------------------------------

>Comment By: Freddy Vulto (fvu-guest)
Date: 2009-12-24 18:58

Message:
Hmm, wasn't aware of this, I'm using bash-3.2.  The nice thing of printf -v is that no subshell is required.  If bash 3.0 needs to be supported maybe we can write a wrapper __vprintf, for example (non-executable code):
__vprintf() {
    if bash-version < 3.1 then
        eval $1=\$(printf \"\$2\" \"\$3\")
    else
        printf -v "$1" "$2" "$3"
    fi
}

I don't know if we can safely set the minimum requirements to bash-3.1?  Are there people on the mailing list how can say something about that?

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312183&group_id=100114



More information about the Bash-completion-devel mailing list