Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
set -A
- X-seq: zsh-users 5885
- From: Paul Ackersviller <paulda@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: set -A
- Date: Thu, 6 Feb 2003 19:01:38 -0500
- Mail-followup-to: Paul Ackersviller <paulda@xxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I think this is a bug in all versions, but if there's some reason
the behaviour could be considered correct, it'd be nice if it at
least worked like ksh in emulation mode. I recently had some trouble
getting a ksh script to work properly in zsh, as illustrated by:
unset arr
set -A arr "${arr[@]}" first
[ ${#arr[@]} = 2 ] && echo "arr[0]='${arr[0]}' arr[1]='${arr[1]}'"
Note the null entry on the start of the array. I believe the above
should work as in ksh, and consistently with positional parameters,
like this:
set --
set -A arr "$@" first
echo arr now has only ${#arr[@]} element
Secondly, I have more of an observation than a bug report that better
fits the subject since it has to do with parsing after the -A of set.
set -A arr -x
puts -x into the beginning of the array, whereas ksh treats the -x as
an option to set instead. In ksh
set -A arr -- -x
would get around that, but the same command in zsh now put the -- into
the array. I think either way could be considered correct, but it
would be nicer if the same command had the same effect in both shells.
--
Paul Ackersviller
Messages sorted by:
Reverse Date,
Date,
Thread,
Author