> > If you are reluctant to change semantics, how about a new parameter > > transformation to quote values using `sh_single_quote'? > > Why, when @Q already exists?
It's often the case that the strings generated by bash are being fed to some other shell, where $'...' doesn't work. Granted, you can always do "'${myvar//$q/$q\\$q$q}'" (where q=\'). If the sh single quoting also helps you use associative array elements inside a math context, then that would be a second reason. But at this point I can't even *guess* whether it's safe to use sh-single-quoted associative array keys inside a math context. I tried one with a command substitution and a newline inside it, and it seemed to work, but that doesn't mean it's *safe*.