On 6/18/20 6:48 PM, Rob Landley wrote:
> On 6/18/20 1:46 PM, Chet Ramey wrote:
>> On 6/17/20 1:22 PM, Rob Landley wrote:
>>> Trying to figure out when spaces are and aren't allowed in ${blah} led to
>>> asking
>>> why echo ${!a* } is an error but ${!a@ } isn't (when there are no variables
>>> starting with a), and I eventually worked out that:
>>>
>>> $ X=PWD
>>> $ echo ${!X@Q}
>>> '/home/landley/toybox/clean'
>>>
>>> Is going on?
>>
>> It's variable transformation. It's introduced by `@' and uses single-letter
>> operators. I cribbed the idea from mksh and extended it. The syntax is kind
>> of loose because I'm still experimenting with it.
>
> I know what the @Q part does:
>
> $ chicken() { echo "${@@Q}"; }; chicken one two three
> 'one' 'two' 'three'
Well, I SORT of know what it does:
$ a='*'; xx() { echo "${!a@Q}";}; xx one two three
'one' 'two' 'three'
Shouldn't that be 'one two three'? (Why do a=@ and a='*' produce the same output
here?)
Rob
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net