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

bug in ${##} expansion



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature



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