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

Re: Shift arguments



On Oct 31,  3:01pm, Peter Stephenson wrote:
}
} % 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.

I can't disagree that it's confusing, but the idea is that you can give
any math expression there, e.g. "shift 7-foo" would shift by 4.  This
is in the same category as passing math expressions to "return".

It's always been like that ...



Messages sorted by: Reverse Date, Date, Thread, Author