Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 'export -p' lacks POSIX output



Op 22-10-16 om 20:24 schreef Bart Schaefer:
> Would anyone object if this just happened all the time, rather than
> depending on POSIXBUILTINS + "export"?

After the patch, variables with a non-scalar type get output such as:

export -i10 SHLVL=2

Option flags to 'export' other than -p are not POSIX, and POSIX
specifies output without any flags for 'export -p'.

Maybe that implies that commands like 'export -p' and 'trap' should
generate commands suitable for any POSIX shell. This would mean the
$'...' quoting method should also be deactivated. It may become POSIX at
some point, but it's anyone's guess how long that will take, and then
shells have to implement it. Then again, POSIX says the input should be
"suitable for reinput to the shell", not "suitable for reinput to any
POSIX shell".[*]

In any case, if the output needs to be conditional upon POSIXBUILTINS
anyway, I reckon you might as well not change the behaviour at all if
POSIXBUILTINS is not active.

- M.

[*]
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_22_04



Messages sorted by: Reverse Date, Date, Thread, Author