zsh-workers
 help / color / mirror / code / Atom feed
* bug in ${##} expansion
@ 2011-03-11 19:07 Eric Blake
  2011-03-11 20:04 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2011-03-11 19:07 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

POSIX requires ${#parameter} to expand to the length of parameter as a
string.  It also requires that ${parameter#word} substitution have a
word (that is, ${parameter#} with a missing word is a zsh extension).

Therefore, this should output 2, not 11:

zsh -c 'set 1 2 3 4 5 6 7 8 9 10 11; echo ${##}'

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-21 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-11 19:07 bug in ${##} expansion Eric Blake
2011-03-11 20:04 ` Peter Stephenson
2011-03-21 10:15   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).