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

Re: var=$( typeset "$1" ) ... not within a function.



On Thu, Oct 20, 2022 at 7:52 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
>
> On 2022-10-20 10:25, Roman Perepelitsa wrote:
> > Try typing `typeset USER` in your interactive shell. What do you get
> > as output?
> > Take a look at typeset_silent option.
>
> There's part of an explanation. 'typeset -m' cures the problem but why
> is there only a problem within the function?  Why this special handling
> of typeset?

The function is a red herring. If you run `unsetopt typeset_silent` in
the function or before invoking it, you'll see the same behavior as
you see in the script. If you read the description of this option,
you'll immediately see that everything works as expected. This option
controls `typeset` in exactly the way you are observing.

Roman.




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