bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very Unexpected response from command 'set'


From: Chet Ramey
Subject: Re: Very Unexpected response from command 'set'
Date: Mon, 16 Dec 2024 11:44:53 -0500
User-agent: Mozilla Thunderbird

On 12/15/24 10:35 AM, Robert Elz wrote:
     Date:        Sat, 14 Dec 2024 19:21:50 -0500
     From:        Greg Wooledge <greg@wooledge.org>
     Message-ID:  <20241215002150.GC30016@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 mode
is 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    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]