On 9/10/16 7:27 AM, Joerg Schilling wrote:

>> Concerning this point, these even number of double-quotes and even
>> number of single-quotes are fulfilled with the example below:
>>
>>   echo "${foo-'a"b'"}"
>>
>> But is this valid?
>>
>> The following shells output 'ab' (with the single quotes):
>> dash, bash --posix, mksh, posh, zsh.
> 
> I cannot repeat this with bash --posix..

Pretty much every version released since 2010.

$ cat x1
echo "${foo-'a"b'"}"
$ ../bash-4.3-patched/bash --version
GNU bash, version 4.3.46(19)-release (x86_64-apple-darwin13.1.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ ../bash-4.3-patched/bash --posix ./x1
'ab'
$ ../bash-4.2-patched/bash --version
GNU bash, version 4.2.53(17)-release (i386-apple-darwin13.1.0)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ ../bash-4.2-patched/bash --posix ./x1
'ab'


-- 
``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