improve exporting documentation:

• reference “shellshock” of GNU bash for exporting functions
• mention we don’t export arrays (just their "0" members) as
  ksh93 and GNU bash don’t do it either, the latter documen‐
  ting it even
This commit is contained in:
tg
2018-04-16 00:32:35 +00:00
parent 99f6aae983
commit d10c196cf1

19
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.452 2018/04/16 00:22:28 tg Exp $ .\" $MirOS: src/bin/mksh/mksh.1,v 1.453 2018/04/16 00:32:35 tg Exp $
.\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $
.\"- .\"-
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
@ -2904,8 +2904,6 @@ option is turned on for the function's duration.
The The
.Dq export .Dq export
attribute of functions is currently not used. attribute of functions is currently not used.
In the original Korn shell,
exported functions are visible to shell scripts that are executed.
.Pp .Pp
Since functions are executed in the current shell environment, parameter Since functions are executed in the current shell environment, parameter
assignments made inside functions are visible after the function completes. assignments made inside functions are visible after the function completes.
@ -4933,9 +4931,9 @@ when used with the
.Fl i .Fl i
option which meant upper case letters would never be used for bases greater option which meant upper case letters would never be used for bases greater
than 10. than 10.
See the See
.Fl U .Fl U
option.) above.)
.Pp .Pp
For functions, For functions,
.Fl u .Fl u
@ -4945,9 +4943,12 @@ See
above for the implications of this. above for the implications of this.
.It Fl x .It Fl x
Export attribute. Export attribute.
Parameters (or functions) are placed in the environment of Parameters are placed in the environment of any executed commands;
any executed commands. this includes the array member with the key
Exported functions are not yet implemented. .Dq 0
if the parameter is an array.
Functions cannot be exported for security reasons
.Pq Dq shellshock .
.It Fl Z Ns Op Ar n .It Fl Z Ns Op Ar n
Zero fill attribute. Zero fill attribute.
If not combined with If not combined with
@ -4955,7 +4956,7 @@ If not combined with
this is the same as this is the same as
.Fl R , .Fl R ,
except zero padding is used instead of space padding. except zero padding is used instead of space padding.
For integers, the number instead of the base is padded. For integers, the number is padded, not the base.
.El .El
.Pp .Pp
If any of the If any of the