Re: Documentation issue

2017-10-29 Thread Eli Barzilay
On Sun, Oct 29, 2017 at 10:44 PM, Clark Wang wrote: > > Different people have different expectations which they believe are > all important. Yes, and I have already went over this several times: this is an issue that does confuse people, both ones that I have spoken to and in

remove empty '' in ${var@Q} result?

2017-10-29 Thread Clark Wang
See following example: [STEP 100] # echo $BASH_VERSION 4.4.12(2)-release [STEP 101] # v=\'\' [STEP 102] # printf '%q\n' "$v" \'\' [STEP 103] # printf '%s\n' "${v@Q}" ''\'''\''' [STEP 104] #

Re: Documentation issue

2017-10-29 Thread Clark Wang
On Fri, Oct 27, 2017 at 3:28 PM, Eli Barzilay wrote: > On Fri, Oct 27, 2017 at 2:37 AM, Clark Wang wrote: > > > > What `unset' does is special but there's nothing special when parsing > > the command and bash even does not care if it's built-in command or

${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

Re: Documentation issue

2017-10-29 Thread Eli Barzilay
On Fri, Oct 27, 2017 at 2:12 PM, Chet Ramey wrote: > > Let's see if I can find some compromise language that will take care > of the general case. Since it's a compromise, no one will be > satisfied, of course. Thanks -- any improvement would be good. --

Unexpanded tilde in DIRSTACK[0]

2017-10-29 Thread Steve Jones
While writing a function to save the directory stack as a script, I noticed that ${DIRSTACK[0]}, the current directory always has the tilde unexpanded. This is the same with bash-4.4.12 and bash-4.3.11. I was wondering if this is an oversight since DIRSTACK[0] is the same as PWD, or intentional.