bug-bash
[Top][All Lists]
Advanced

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

Re: `printf -v foo ""` does not set foo=


From: Chris Down
Subject: Re: `printf -v foo ""` does not set foo=
Date: Mon, 17 Jun 2013 13:41:51 +0800

On 17 June 2013 13:27, Mike Frysinger <vapier@gentoo.org> wrote:
> simple test code:
>         unset foo
>         printf -v foo ""
>         echo ${foo+set}
>
> that does not display "set".  seems to have been this way since the feature
> was added in bash-3.1.

Interesting. It also won't change it if it already exists, it seems:

$ foo=bar
$ printf -v foo ""
$ echo "$foo"
bar
$ echo "$BASH_VERSION"
4.2.45(2)-release



reply via email to

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