[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `printf -v foo ""` does not set foo=
From: |
Chet Ramey |
Subject: |
Re: `printf -v foo ""` does not set foo= |
Date: |
Mon, 24 Jun 2013 16:13:01 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
Chet
- --
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlHIqEwACgkQu1hp8GTqdKuxWgCfWco3J9SOm/N+pQh8BNC64be4
ngkAn2d4BsB2lkvRpRTCIK5iqZgEguo+
=92+u
-----END PGP SIGNATURE-----