From owner-freebsd-bugs Sat Mar 8 15:50:14 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 741DD37B401 for ; Sat, 8 Mar 2003 15:50:12 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D6D243F85 for ; Sat, 8 Mar 2003 15:50:12 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h28NoBNS017709 for ; Sat, 8 Mar 2003 15:50:11 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h28NoB4I017708; Sat, 8 Mar 2003 15:50:11 -0800 (PST) Date: Sat, 8 Mar 2003 15:50:11 -0800 (PST) Message-Id: <200303082350.h28NoB4I017708@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Robert Drehmel Subject: Re: bin/49038: /bin/sh does not undefine a function when unset is issued Reply-To: Robert Drehmel Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/49038; it has been noted by GNATS. From: Robert Drehmel 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