Date: Sat, 8 Mar 2003 15:50:11 -0800 (PST) From: Robert Drehmel <robert@zoot.drehmel.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/49038: /bin/sh does not undefine a function when unset is issued Message-ID: <200303082350.h28NoB4I017708@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/49038; it has been noted by GNATS. From: Robert Drehmel <robert@zoot.drehmel.com> To: freebsd-gnats-submit@FreeBSD.org Cc: jau@iki.fi Subject: Re: bin/49038: /bin/sh does not undefine a function when unset is issued Date: Sun, 9 Mar 2003 00:49:45 +0100 Hello. > The bourne shell does not undefine a previously declared shell > function when unset command is given though the manual pages > so imply. I think it is pretty clear that a plain "unset name" does not undefine functions. From the sh(1) manual page: """ unset [-fv] name ... The specified variables or functions are unset and unexported. If the -v option is specified or no options are given, the name arguments are treated as variable names. If the -f option is specified, the name arguments are treated as function names. """ > This is a serious portability problem for imported shell scripts. If these shell scripts rely on "unset name" to remove a function named "name", they should be regarded as unportable. From POSIX.1-2001: """ If neither -f nor -v is specified, name refers to a variable; if a variable by that name does not exist, it is unspecified whether a function by that name, if any, shall be unset. """ ciao, -robert To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303082350.h28NoB4I017708>