From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27501 invoked by alias); 31 Oct 2012 16:34:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30773 Received: (qmail 22339 invoked from network); 31 Oct 2012 16:34:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <121031093338.ZM11762@torch.brasslantern.com> Date: Wed, 31 Oct 2012 09:33:38 -0700 In-reply-to: <20121031150140.32569722@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Shift arguments" (Oct 31, 3:01pm) References: <20121031134007.GA9731@localhost.localdomain> <20121031142546.529e1709@pwslap01u.europe.root.pri> <20121031150140.32569722@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: Shift arguments MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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 ...