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

Re: Associative Arrays



On Fri, Oct 22, 2004 at 08:07:13AM -0700, Bart Schaefer wrote:
[...]
>      The behaviour of arguments after -A NAME or +A NAME depends on
>      whether the option KSH_ARRAYS is set.  If it is not set, all
>      arguments following NAME are treated as values for the array,
>      regardless of their form.  If the option is set, normal option
>      processing continues at that point; only regular arguments are
>      treated as values for the array.  This means that
> 
>           set -A array -x -- foo
> 
>      sets array to `-x - foo' if KSH_ARRAYS is not set, but sets the
>      array to foo and turns on the option `-x' if it is set.
[...]

You're right. I was wrong.

I had tested:
set -A a -- foo
echo $a
(but not in ksh compatibility mode)

and
set -A a -e foo
echo $a

And of course, the "-e" was grabbed by echo...

Sorry for that,
Stephane



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