Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Local variable declaration in loops buglet...
- X-seq: zsh-workers 19222
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Local variable declaration in loops buglet...
- Date: Wed, 5 Nov 2003 04:08:15 +0000
- In-reply-to: <87y8uv3chb.fsf@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <87y8uv3chb.fsf@xxxxxxxxxxxxxxxx>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author