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

Re: Question on unintuitive behaviour for function execution and parameter assignment



> On 13 October 2021 at 09:42 Jett Husher <jetthusher@xxxxx> wrote:
> On Tuesday, October 12th, 2021 at 10:31, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > This is covered by the POSIX_BUILTINS option. Generally, the POSIX_* options are
> >
> > the place to look for this sort of think --- granted that can be a bit of hunt.
> 
> I wouldn't even think to look at POSIX_* variables because POSIX-2017
> explicitly tells that it's unspecified "Whether or not the variable assignments persist after
> the completion of the function", so, naturally, I though that this behaviour was compliant.

It's always worth (everyone) bearing in mind that zsh is not a POSIX shell by default.

In fact, it's not *completely* POSIX even in sh emulation, as this has been gradually
retrofitted, and not everything can be done within the current constraints.

cheers
pws




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