[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `printf -v foo ""` does not set foo=
From: |
Mike Frysinger |
Subject: |
Re: `printf -v foo ""` does not set foo= |
Date: |
Mon, 24 Jun 2013 18:52:55 -0400 |
User-agent: |
KMail/1.13.7 (Linux/3.8.3; KDE/4.6.5; x86_64; ; ) |
On Monday 24 June 2013 16:13:01 Chet Ramey wrote:
> On 6/17/13 1:27 AM, Mike Frysinger 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.
>
> printf returns immediately if the format string is null. It has always
> been implemented this way.
seems like when the -v arg is in use, that [otherwise reasonable] shortcut
should be not taken ?
-mike
signature.asc
Description: This is a digitally signed message part.