bug-bash
[Top][All Lists]
Advanced

[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: Chet Ramey
Subject: Re: unset does not remove functions like a[b] unless -f is specified
Date: Fri, 3 Feb 2023 11:04:46 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.0

On 1/4/23 12:56 PM, Emanuele Torre wrote:
The unset builtin, when invoked without an option, should first try to
unset the variable (or array element) specified by its arguments, and
then fall back to trying to remove the function definition for the
function that has the name specified by the argument if it exists.

Thanks for the report. I agree with this if the array variable doesn't
exist. If the array variable exists, and this is simply trying to unset
an unset element, it should not attempt to unset a shell function.

This is mostly theoretical, anyway. You don't see function names like
this in real life.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]