Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Shift arguments
- X-seq: zsh-workers 30772
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Shift arguments
- Date: Wed, 31 Oct 2012 15:01:40 +0000
- In-reply-to: <20121031142546.529e1709@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <20121031134007.GA9731@localhost.localdomain> <20121031142546.529e1709@pwslap01u.europe.root.pri>
On Wed, 31 Oct 2012 14:25:46 +0000
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> It looks like this is hitting some pathology in memory management to
> do with the argument array (which is being shifted at that line).
Looking at the code, I found a feature of shift I'm not sure I like:
% integer foo=3
% set -- one two three four five six
% shift foo
% print $*
four five six
In other words, if the argument to shift is a parameter that isn't an
array, it's used to give a mathematical value with which to shift the
positional parameters. That seems confusing.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author