From 50c56d91ef99a1d480d0910160fc9f9cbffd18c6 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 30 Jul 2022 02:06:11 +0200 Subject: [PATCH] sh.1: remove inaccurate sentence about unset discipline In the documentation on the .unset discipline, this removes the sentence: "The variable will not be unset unless it is unset explicitly from within this discipline function." Every ksh93 version published since at least 1995 unsets a variable if 'unset' is run, regardless of whether any .unset discipline function itself unsets the variable or not. But all the documentation and books ever published (man page, Bolsky, O'Reilly, IBM AIX docs) claim that an .unset discipline needs to unset the variable again in order for it to be unset. Bolsky (1995) p. 79, says: > unset > Called when the variable is unset. The variable will not be > unset unless it is unset inside the dicipline function. Other similar claims: https://github.com/ksh93/ksh/issues/419#issuecomment-1199773432 So, ALL OF IT IS WRONG, believe it or not. Welcome to the ksh93 twilight zone, where nothing is as it seems. There are other bugs, see #419. But for now, other than correcting the man page, I'm not touching this mess with a ten-foot pole. --- src/cmd/ksh93/sh.1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 5277cb1aa..eb81620f3 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -4085,8 +4085,6 @@ If \f3.sh.value\fP is unset inside the discipline, then that value is unchanged. If the \f3unset\fP discipline is defined for a variable, it is invoked whenever the given variable is unset. -The variable will not be unset unless it is unset explicitly -from within this discipline function. .PP The variable .B .sh.name