Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Local variable declaration in loops buglet...
- X-seq: zsh-workers 19224
- From: Philippe Troin <phil@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Local variable declaration in loops buglet...
- Date: 04 Nov 2003 22:53:38 -0800
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <1031105040815.ZM3307@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-copies-to: nobody
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <87y8uv3chb.fsf@xxxxxxxxxxxxxxxx> <1031105040815.ZM3307@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: Philippe Troin <phil@xxxxxxxx>
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
> On Nov 4, 4:06pm, Philippe Troin wrote:
> }
> } ceramic% foo() { for i in 1 2 3; do local x; x=$i;done }
> }
> } Moving the local out of the loop fixes the echo of course... But I do
> } not think it should matter.
>
> This is not a bug, it's documented behavior of `typeset' for which
> `local' is an alias:
>
> For each remaining name that refers to a parameter that is set,
> the name and value of the parameter are printed in the form of an
> assignment. Nothing is printed for newly-created parameters, or when
> any attribute flags listed below are given along with the name.
>
> In 4.1.1-dev, you can `setopt typeset_silent' to suppress this.
Oops. Did not know this behavior. Sorry for the noise.
Phil.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author