Dixi quod… >┌──────────────┬────────────────┬──────────┬────────────────────┬──────────┐ >│ shell \ what │ inside visible │ exported │ afterwards visible │ exported │ >├──────────────┼────────────────┼──────────┼────────────────────┼──────────┤ >│ ksh93 │ ✔ as required │ ✗ (ok) │ ✗ no, permitted │ – │ >│ mksh ±posix │ ✔ as required │ ✓ (good) │ ✓ yes, permitted │ ✓ (ok) │ >│ posh (old) │ ✔ as required │ ✓ (good) │ ✗ no, permitted │ – │ >└──────────────┴────────────────┴──────────┴────────────────────┴──────────┘
>The “afterwards visible” property is dividing. Hiding it would be >consistent related to how assignments are handled running non-functions, Looking at POSIX again, same place: * If the command name is a standard utility implemented as a function (see XBD [142]Utility), the effect of variable assignments shall be as if the utility was not implemented as a function. This is easier, not to mention more reliable to do, if all function invocations are handled as if the callee is not a function, that is, inside visible plus exported, outside untouched. I’m strongly considering changing mksh to match; note this was not changed deliberately before / from pdksh/oksh. bye, //mirabilos -- This space for rent. https://paypal.me/mirabilos to support my work.