On Fri, Oct 31, 2003 at 01:43:31AM -0800, Luigi Rizzo wrote: [snip description of a new 'indexes' builtin] > Any comments ? Is this interesting enough to be committed > (with a proper manpage description) ? > I could provide a flag to "indexes" to return the values instead > of the names, but i believe this form is more useful.
Just a minor suggestion: could this be done as another form of variable
expansion instead of as another keyword? Rationale: bash already does
this - from the 'EXPANSION' section of its manpage:
${!prefix*}
Expands to the names of variables whose names begin with prefix,
separated by the first character of the IFS special variable.
Thus, 'indexes foo_' would be equivalent to '${!foo_*}'.
What you've done is great - several times I've found myself wishing that
our sh had this, especially after finding that bash does it - but
wouldn't it be better not to introduce a gratuitious syntax
incompatibility if we can help it? :)
G'luck,
Peter
--
Peter Pentchev [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
If this sentence were in Chinese, it would say something else.
pgp00000.pgp
Description: PGP signature

