2023年1月5日(木) 2:56 Emanuele Torre <torreemanue...@gmail.com>: > [...] > > It seems that, if an operand of unset is in the form of > validvariablename[something], the unset builtin invoked without options, > will only attempt to delete an array element specified by that argument, > and will not fall back to removing a function named like the argument > (as if the -v option was passed only for that argument). > You must specify the -f option to delete a function with a name in > that form.
Putting aside the discussion on removing the support for non-POSIX function names from Bash, as far as we support the other forms of non-POSIX function names for « unset 'any-funcname-other-than-arr[index]' » and all the non-POSIX function names for « unset -f 'any-funcname' », there is no reason that we do not support « unset 'arr[index]' ». > [...] bash's unset builtin should fall > back to trying to remove the function named "a[0]" in those cases. I agree with this.