From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13758 invoked from network); 15 Oct 2001 17:28:47 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 15 Oct 2001 17:28:47 -0000 Received: (qmail 81 invoked by alias); 15 Oct 2001 17:28:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16056 Received: (qmail 64 invoked from network); 15 Oct 2001 17:28:39 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: questions - calling matheval() for printf In-reply-to: "Oliver Kiddle"'s message of "Mon, 15 Oct 2001 18:11:09 BST." <3BCB18AD.9C7217A7@yahoo.co.uk> Date: Mon, 15 Oct 2001 18:28:11 +0100 Message-ID: <9831.1003166891@csr.com> From: Peter Stephenson Oliver Kiddle wrote: > The question is how should this interact with the printf(1) feature of > reusing the format if more arguments remain. The easy answer would be > to not reuse the format if this feature had been used. As an > experiment, I've made it remove all arguments up to the last one used. > This allows interesting things like: > > % printf '%2$s %1$s ' 1 2 3 4 5 6 ;echo > 2 1 4 3 6 5 > > I can see this having some uses but I can also see it being a problem > as this is likely to be used for picking out fields where the arguments > are some command in $(...). Even in that case, the problem is really with the reuse of the format, rather than the special argument-picking syntax. Maybe it would be best to have a command-line option to turn it (the reuse of the format specifier, that is) off --- or even on, since it might be regarded as a little florid for default behaviour. But I suppose we're going to have to stick with ksh if we're trying to match it. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************