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 mode is turned on in bash, only the variables are 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. | If you ONLY want to see variables, you can use 'declare -p' instead. Or just turn on posix mode, which most of the time is a good idea anyway (and will be better once bash eventually stops enforcing "name" rules for function names in posix mode, which posix never required, and in the current version, is quite explicit about). (nb: posix does require conforming applications to only use "name"s as function names, but that is quite a different thing.) kre