Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] emulate sh: arith assignment assigns variable type
- X-seq: zsh-workers 37491
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: [BUG] emulate sh: arith assignment assigns variable type
- Date: Sat, 2 Jan 2016 20:37:32 +0100
- Cc: Martijn Dekker <martijn@xxxxxxxx>, zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2MjjkhYIlDV32LQhKyVAhfdB0qyhenBLCQF5JFvv4tI=; b=0BU0NWor1QHe1eOZaS4rYhBJD2Tx2haydY47braYNnfanN5LvtAogn/5DT8Cjl/jOt ZKMRnDTE9Msi8TsQBsie0wC6Ydqj+ZcyF3JYYBlMVffA1WvNOkBXLi4fIjPmh6mr4JCi XCGEEpBg39ro4LXY4BitbekbC52H+DuCHzOYHNNuaB571sf3jhPjkIugmO7vp7C18BAu 0xHwEzU7xQNy18nS/vXtuGawkvec6fw95fJlpfHKdYItyFJtUsDQ51vdF329wc5PtjjO YEiidf/52nnnMCRskB3rY5uzAuTuBAlWqXO6DcXmc93XxrXkfP6tiQbmecvc1OWxqKaL +v5g==
- In-reply-to: <20160102181126.364cc450@ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <5686DB95.2090602@inlv.org> <20160102181126.364cc450@ntlworld.com>
On Sat, Jan 2, 2016 at 7:11 PM, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Fri, 01 Jan 2016 21:03:33 +0100
> Martijn Dekker <martijn@xxxxxxxx> wrote:
>> When an assignment is done to an unset variable using an arithmetic
>> expression, zsh assigns a numerical or arithmetic type to that variable,
>> causing subsequent normal shell assignments to be interpreted as
>> arithmetic expressions.
>
> Yes, it does.
>
> Does this need a special option? The linkage is a bit tenouous.
>
> diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
> index f377539..b5e9100 100644
> --- a/Doc/Zsh/options.yo
> +++ b/Doc/Zsh/options.yo
> @@ -2098,6 +2098,12 @@ When it is unset, zsh allows expressions of the form tt($#)var(name)
> to refer to the length of tt($)var(name), even for special variables,
> for example in expressions such as tt($#-) and tt($#*).
>
> +Another difference is that with the option set assignment to an
> +unset variable in artihmetic context causes the variable to be created
Typo here on artihmetic. I would also put a comma after 'with the option set'?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author