zsh-users
 help / color / mirror / code / Atom feed
* set -A
@ 2003-02-07  0:01 Paul Ackersviller
  2003-02-07  3:53 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Ackersviller @ 2003-02-07  0:01 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-07 17:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07  0:01 set -A Paul Ackersviller
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

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).