Subject: Re: /bin/sh and functions
To: None <tech-userlevel@NetBSD.org>
From: Klaus Heinz <k.heinz.mai.vier@onlinehome.de>
List: tech-userlevel
Date: 05/27/2004 12:19:50
--ew6BAiZeqk4r7MaW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

David Laight wrote:

> Also 'unset -e' is definitely an NewtBSD'ism, and could be deliberately
> undocumented.

> If documented, it ought to be marked as non-standard.

So, should we document '-e' at all or should I leave it out? (New patch
attached.)

ciao
     Klaus

--ew6BAiZeqk4r7MaW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sh.1.diff2"

--- sh.1.orig	Sun Dec 21 12:16:23 2003
+++ sh.1	Thu May 27 12:00:01 2004
@@ -1761,10 +1761,20 @@
 If
 .Fl a
 is specified, all aliases are removed.
-.It unset Ar name ...
-The specified variables and functions are unset and unexported.
-If a given name corresponds to both a variable and a function, both
-the variable and the function are unset.
+.It unset Xo
+.Op Fl efv
+.Op Ar name ...
+.Xc
+The specified variables (
+.Fl v ,
+the default) and functions (
+.Fl f
+) are unset. The exit status reflects whether the variables or function were
+already unset (non-zero) or not (zero).
+.Pp
+Note that option
+.Fl e
+is only valid for variables and un-exports them. This is a non-standard extension in NetBSD.
 .It wait Op Ar job
 Wait for the specified job to complete and return the exit status of the
 last process in the job.

--ew6BAiZeqk4r7MaW--