On 3/7/14, 2:42 PM, David Sines wrote:
> Bash Version: 4.3
> Patch Level: 0
> Release Status: release
>
> Description:
> When invoked as sh, bash 4.3.0 doesn't interpret C-style escapes
> within double-quoted substitution expansions ("${var/$'what'/ever}").
I think this is a bug; this is the wrong place for posix-mode treatment of
single quotes inside double-quoted word expansions. Here's a patch that
makes posix mode behave like the default in this case.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3/parse.y 2014-02-11 09:42:10.000000000 -0500
--- parse.y 2014-03-07 20:57:15.000000000 -0500
***************
*** 3399,3403 ****
unescaped double-quotes or single-quotes, if any, shall occur." */
/* This was changed in Austin Group Interp 221 */
! if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
continue;
--- 3399,3403 ----
unescaped double-quotes or single-quotes, if any, shall occur." */
/* This was changed in Austin Group Interp 221 */
! if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
continue;