Re: ${var@Q}: don't quote unless necessary?

2017-10-30 Thread Chet Ramey
On 10/29/17 10:48 PM, Clark Wang wrote: > See following example: > > [STEP 100] # echo $BASH_VERSION > 4.4.12(2)-release > [STEP 101] # v=abc > [STEP 102] # printf '%q\n' $v > abc > [STEP 103] # printf '%s\n' "${v@Q}" > 'abc' > [STEP 104] # > > Is it possible to not quote the result since there's

${var@Q}: don't quote unless necessary?

2017-10-29 Thread Clark Wang
See following example: [STEP 100] # echo $BASH_VERSION 4.4.12(2)-release [STEP 101] # v=abc [STEP 102] # printf '%q\n' $v abc [STEP 103] # printf '%s\n' "${v@Q}" 'abc' [STEP 104] # Is it possible to not quote the result since there's no special chars in the string? I would expect ${var@Q} to prod