From: Paul Ackersviller <paulda@rogers.com>
To: zsh-users@sunsite.dk
Subject: set -A
Date: Thu, 6 Feb 2003 19:01:38 -0500 [thread overview]
Message-ID: <20030207000138.GK5418@msi.ld> (raw)
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
next reply other threads:[~2003-02-07 0:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-07 0:01 Paul Ackersviller [this message]
2003-02-07 3:53 ` Bart Schaefer
2003-02-07 10:48 ` Peter Stephenson
2003-02-07 16:48 ` Bart Schaefer
2003-02-07 17:36 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030207000138.GK5418@msi.ld \
--to=paulda@rogers.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).