On 12/15/24 10:35 AM, Robert Elz wrote:
Date: Sat, 14 Dec 2024 19:21:50 -0500 From: Greg Wooledge <g...@wooledge.org> Message-ID: <20241215002150.gc30...@wooledge.org>| The output of "set" includes more than just variables. It also includes | shell functions. But that's a clear standards violation - but to be clear, if posix modeis turned on in bash, only the variables are output.
If posix mode is off, bash can do what it wants with the output.
It could be perhaps argued that including the functions is just an extension, but it isn't, as the standard also specifies the format to be used for the output, and the way functions are (effectively must be) output isn't in the required format.
Since POSIX doesn't apply unless posix mode is enabled, bash can output functions as part of `set' output and use an output format that bash can re-read as input. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature