Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bug in ${##} expansion
- X-seq: zsh-workers 28888
- From: Eric Blake <eblake@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: bug in ${##} expansion
- Date: Fri, 11 Mar 2011 12:07:20 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
- Organization: Red Hat
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