[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unset does not remove functions like a[b] unless -f is specified
From: |
Koichi Murase |
Subject: |
Re: unset does not remove functions like a[b] unless -f is specified |
Date: |
Fri, 3 Feb 2023 15:29:18 +0900 |
2023年1月5日(木) 2:56 Emanuele Torre <torreemanuele6@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.
Re: unset does not remove functions like a[b] unless -f is specified, Chet Ramey, 2023/02/03
Re: unset does not remove functions like a[b] unless -f is specified, Robert Elz, 2023/02/03
Re: unset does not remove functions like a[b] unless -f is specified,
Koichi Murase <=
Re: unset does not remove functions like a[b] unless -f is specified, Chet Ramey, 2023/02/03
Re: unset does not remove functions like a[b] unless -f is specified, Chet Ramey, 2023/02/03