Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Weird error message when using bash or ksh form of array initialization
- X-seq: zsh-workers 25523
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Subject: Re: Weird error message when using bash or ksh form of array initialization
- Date: Sun, 24 Aug 2008 13:32:18 -0700
- In-reply-to: <6cd6de210808240905s40c8c86ch4766b711e87ffde5@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210808240905s40c8c86ch4766b711e87ffde5@xxxxxxxxxxxxxx>
On Aug 24, 12:05pm, Rocky Bernstein wrote:
}
} When I run this (erroneous?) program:
}
} typeset -a fd=()
Zsh does not support that syntax; typeset is a command, not a keyword,
so its arguments are parsed like normal shell words, not like parameter
assignments.
As Mikael pointed out, the above syntax defines three functions, named
"typeset", "-a", and "fd=", because the shell word "()" is a token that
denotes that a function name precedes it and a function body follows.
Quoting it as 'fd=()' like Mikael suggested would prevent the function
definition interpretation, but produces the error "can't assign initial
value for array".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author