On 11/2/17 7:03 AM, Michael F Gordon wrote:
> Can anyone explain the following?
> 
> tla19> set|grep FOOFOOFOO
> tla19> if [ -d ${FOOFOOFOO:=""} ]; then echo YES;fi
> YES
> tla19> echo $BASH_VERSION 
> 4.4.12(1)-release

Greg is correct. This expands to [ -d ], which is true.  There was an
expansion bug in bash-4.1 that caused ${FOOFOOFOO:=""} to expand to the
empty string, but that was fixed almost eight years ago as the result of
http://www.austingroupbugs.net/view.php?id=221

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to