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

Shift arguments



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