Re: [PATCH v2 3/5] completion: add and use __git_compute_first_level_config_vars_for_section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Philippe Blain <levraiphilippeblain@xxxxxxxxx> writes:

>> A silly question (primarily because I do not much use the indirect
>> reference construct ${!name}).  Does the assignment with printf need
>> to spell out the long variable name with "_${section}"?  Can it be
>> 
>>     printf -v "$this_section" ...
>> 
>> instead, as we already have the short-hand for it?
>
> No, unfortunately neither "$this_section" nor "${!this_section}"
> work, so we must use the long name.

Hmph, this does not match my experiment, though.  What am I doing
wrong?

        bash$ vname=foo
        bash$ foo=bar
        bash$ set | grep foo
        foo=bar
        vname=foo
        bash$ printf -v "$vname" "%d" 1234
        bash$ set | grep foo
        foo=1234
        vname=foo
        bash$ echo $BASH_VERSION
        5.2.21(1)-release





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux