Re: functions can be created with dotted name but not removed
From:
Chet Ramey
Subject:
Re: functions can be created with dotted name but not removed
Date:
Fri, 04 Dec 2009 23:55:11 -0500
User-agent:
Thunderbird 2.0.0.23 (Macintosh/20090812)
Michael O'Donnell wrote:
> Bash Version: 4.0
> Patch Level: 28
> Release Status: release
>
> Description:
>
> A bash function with a dot in its name can be created and used with no
> problems but cannot be removed - the "unset" command chokes on the name.
It's true -- the shell allows you to define a function with an invalid
name containing a dot (in retrospect, probably not the wisest choice).
Since `unset' without options assumes it is unsetting a variable, and
bash doesn't allow you to create a variable whose name contains a dot,
you need to tell unset you're removing a function: `unset -f f.dot'.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/