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

Re: questions - calling matheval() for printf



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 <pws@xxxxxxx>                  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.
**********************************************************************



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